예제 #1
0
파일: User.php 프로젝트: joshauza/baseapp
 public function getSearchIndexField()
 {
     $result = array();
     $result['class'] = 'users';
     $result['key'] = $this->id;
     $result['title'] = SiteConstants::createName($this->firstname, $this->lastname, $this->mi, $this->designation);
     $result['contents'] = "";
     $result['summary'] = "Email address: " . $this->email_add . " Contact number: " . $this->contacts;
     $result['createdBy'] = $this->user_created;
     $result['dateCreated'] = $this->date_created;
     return $result;
 }
예제 #2
0
파일: Users.php 프로젝트: joshauza/baseapp
 private function getStructuredArray($aUsers, $bEditAllowed = false, $bDeleteAllowed = false, $bApproveAllowed = false, $bDenyAllowed = false)
 {
     $aFinalUsers = array();
     for ($i = 0, $count = count($aUsers); $i < $count; $i++) {
         $aItem = array();
         $aItem['id'] = $aUsers[$i]['id'];
         $aItem['name'] = SiteConstants::createName($aUsers[$i]['firstname'], $aUsers[$i]['lastname'], $aUsers[$i]['mi'], $aUsers[$i]['designation']);
         $aItem['status'] = $aUsers[$i]['status'];
         $aItem['email_add'] = $aUsers[$i]['email_add'];
         $aItem['contacts'] = $aUsers[$i]['contacts'];
         $aItem['date_created'] = $aUsers[$i]['date_created'];
         $aItem['user_created'] = $aUsers[$i]['user_created'];
         $aItem['date_modified'] = $aUsers[$i]['date_last_modified'];
         $aItem['user_modified'] = $aUsers[$i]['user_last_modified'];
         $aItem['edit'] = $bEditAllowed;
         $aItem['delete'] = $bDeleteAllowed;
         $aItem['approve'] = $bApproveAllowed;
         $aItem['deny'] = $bDenyAllowed;
         $aItem['alreadyapproved'] = $aUsers[$i]['status'] === SiteConstants::$REG;
         $aFinalUsers[$aUsers[$i]['id']] = $aItem;
     }
     return $aFinalUsers;
 }
예제 #3
0
 public function editmyprivilegeAction()
 {
     $user = $this->_helper->_aclHelper->getCurrentUser();
     $userRoleId = $user->id;
     $userId = $user->sysUserId;
     $message = "";
     $form = new Form_UserEditPrivilege('/users/editmyprivilege/');
     $form->setData(array('user_role_id' => $userRoleId));
     $form->init();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $this->users->updatePrivilege($userId, $this->getRequest()->getPost());
             $message = "New information has been successfully updated. Privilege changes will reflect next time you logged in.";
         } else {
             $form->populate($this->getRequest()->getPost());
             $message = 'Submission Failed. See errors below.';
         }
     }
     if ($this->getRequest()->isGet()) {
         $personalData = $this->users->getPersonalData($userId)->toArray();
         $accountData = $this->users->getAccountData($userRoleId)->toArray();
         $this->view->title = SiteConstants::createName($personalData['firstname'], $personalData['lastname'], $personalData['mi'], $personalData['designation']);
         $form->populate($accountData);
     }
     $this->view->links = $this->_helper->_linksHelper->getLinks($user->sysRoleId, $this->view);
     $this->view->form = $form;
     $this->view->message = $message;
 }