public function addNewPersonalData($post) { $users = new DB_Users(); $user = $users->createRow(); $user->lastname = $post['lastname']; $user->firstname = $post['firstname']; $user->contacts = $post['contact']; $user->email_add = $post['emailadd']; $user->mi = $post['mi']; $user->designation = $post['designation']; return $user->save(); }
public function addNewPersonalData($oPost) { $users = new DB_Users(); $user = $users->createRow(); $user->lastname = $oPost['lastname']; $user->firstname = $oPost['firstname']; $user->address = $oPost['address']; $user->contacts = $oPost['contact']; $user->email_add = $oPost['emailadd']; $user->district = $oPost['districts']; $user->mi = $oPost['mi']; $user->designation = $oPost['designation']; if ((int) $oPost['roles'] === SiteConstants::$VOTER_ID) { $user->searchable = 1; } return $user->save(); }
public function isValid($value, $context = null) { //string from form e.g. username $this->_setValue((string) $value); //array of strings from other form values if (is_array($context)) { if (!isset($context['password'])) { return false; } } //get Db Adapter $adapter = Zend_Registry::get('db'); //get Auth Adapter $this->_authAdapter = new Zend_Auth_Adapter_DbTable($adapter); $this->_authAdapter->setTableName('sys_user_roles')->setIdentityColumn('username')->setCredentialColumn('password'); //set identity column $this->_authAdapter->setIdentity($context['username']); //set credential column $this->_authAdapter->setCredential($context['password']); //do the authentication $oAuth = Zend_Auth::getInstance(); $result = $oAuth->authenticate($this->_authAdapter); if (!$result->isValid()) { $this->_error('notAuthorised'); return false; } $data = $this->_authAdapter->getResultRowObject(null, 'password'); if ($data->status !== SiteConstants::$REG) { $this->_error('notAuthorised'); return false; } Zend_Loader::loadClass('DB_Users'); $sysUsers = new DB_Users(); $sUserId = $sysUsers->fetchRow('id=' . $data->sys_user_id . ' AND deleted=0'); if (empty($sUserId) && is_null($sUserId)) { $this->_error('notAuthorised'); return false; } return true; }
function get_All_Users_Managers() { $manager_list = new DB_Users(); return $manager_list->db_Get_All_Users_Managers(); }