function updateUserDataIntoSession($username)
 {
     $db = \Zend_Registry::get('db');
     $select = $db->select()->from('user')->where('username=?', $username);
     $user = $select->query()->fetch();
     \Zend_Registry::set('user', $user);
     \bootstrap::getInstance()->getSession()->user = $user;
 }
Beispiel #2
0
 public function buildPrivilegeRights()
 {
     # Registry for Database Access
     $registry = bootstrap::getRegistry();
     $this->roles = [];
     $query = sprintf('SELECT table1.role_id, table2.role_name FROM hybrid_user_rule as table1 JOIN hybrid_roles as table2 ON table1.role_id table2.role_id WHERE table1.user_id = %d', $account->getID());
     $statement = $registry->database->query($query);
     while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
         $this->roles[$row['rule_name']] = helper\Authicate::getPermissions($row['role_id']);
     }
 }
Beispiel #3
0
 public static function removeUserRole($role)
 {
     $registry = bootstrap::getRegistry();
     $query = sprintf('DELETE FROM hybrid_user_role WHERE hybrid_user = %d', $role);
     return $registry->database->query($query);
 }