1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-21 23:06:16 +00:00

Add configmapper::getKey to get user settings

This commit is contained in:
Loic Blot 2015-01-09 17:17:33 +00:00
parent 3d8c834a43
commit 74ed1e7527

View File

@ -54,6 +54,19 @@ class ConfigMapper extends Mapper {
return false;
}
}
public function getKey($key) {
try {
$sql = "SELECT key FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?";
$result = $this->findEntity($sql, array($key, $this->user));
foreach ($result as $r) {
return $this->crypto->decrypt($r->getValue());
}
return false;
} catch (DoesNotExistException $e){
return false;
}
}
};
?>