Exemplo n.º 1
0
 public static final function _GetPageRights(DBConnect &$db, $pageID){
     logger_FuncCall(__FILE__, __LINE__, __FUNCTION__);
     if (!is_numeric($pageID)){ throw new InvalidParamException(1, _T::NUMBER); }
     $result = $db->makeQuery("SELECT * FROM pageRights WHERE pageID=$pageID");
     $orderResults = array();
     $count = sizeof($result);
     for($i=0; $i<$count; $i++){
         $orderResults[ $result[$i][PAGERIGHTS_USERID] ] = $result[$i][PAGERIGHTS_USERRIGHT];
     }
     $allUserIDs = DB_USER::_GetUserList($db);
     $count = sizeof($allUserIDs);
     $returning = array();
     for($i=0; $i<$count; $i++){
         $returning[$i][USERS_USERID] = $allUserIDs[$i][USERS_USERID];
         $returning[$i][USERS_USERNAME] = $allUserIDs[$i][USERS_USERNAME];
         if (isset($orderResults[ $allUserIDs[$i][USERS_USERID] ])){
             $returning[$i][PAGERIGHTS_USERRIGHT] = $orderResults[ $allUserIDs[$i][USERS_USERID] ];
         } else {
             $returning[$i][PAGERIGHTS_USERRIGHT] = 0;
         }
     }
     return $returning;
 }
Exemplo n.º 2
0
 protected function UserSelectOption_GET(DBConnect &$db){
     $this->crossInfo[PAGES_USERID] = _FCORE::IsSetPostDefault(PAGES_USERID,
             _FCORE::IsSetPostDefault(PAGES_USERID, null));
     $userList = DB_USER::_GetUserList($db);
     $count = sizeof($userList);
     $found = 0;
     $this->crossInfo[_ADMINPAGE::USERS_LIST] = array();
     for($i=0; $i<$count; $i++){
         if ($userList[$i][PAGES_USERID]!=_SESSION::GetUserID() &&
             $userList[$i][USERS_USERNAME]!=_SESSION::GUEST){
             if ($this->crossInfo[PAGES_USERID]==null){
                 $this->crossInfo[PAGES_USERID] = $userList[$i][PAGES_USERID];
             }
             $this->crossInfo[_ADMINPAGE::USERS_LIST][$found] = $userList[$i];
             $found++;
         }
     }
 }