Пример #1
0
 public function __construct()
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
     }
 }
Пример #2
0
 public function preDispatch()
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
         $this->_sSiteUrl = $this->_oAuth->getStorage()->read()->site_url;
     }
     if ($this->_oAuth->hasIdentity() && $this->_sSiteUrl != str_replace("/", "", $this->view->baseUrl())) {
         $this->_oAuth->clearIdentity();
     }
 }
Пример #3
0
 public function preDispatch()
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
         $this->_nRoleName = $this->_oAuth->getStorage()->read()->role_name;
         $this->_sSiteUrl = $this->_oAuth->getStorage()->read()->site_url;
     }
     if ($this->_oAuth->hasIdentity() && $this->_sSiteUrl != str_replace("/", "", $this->view->sBaseUrl)) {
         $this->_oAuth->clearIdentity();
     } else {
         $this->_redirect("/admin/settings");
     }
 }
Пример #4
0
 public function __construct($options = null)
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
     }
     $oModelUser = new Admin_Model_User();
     $oAllUser = $oModelUser->findUsers(array(3, 4));
     if (isset($oAllUser)) {
         $this->_aAllUser[0] = "-";
         foreach ($oAllUser as $oValue) {
             $this->_aAllUser[$oValue->id] = trim($oValue->first_name . " " . $oValue->last_name);
         }
     }
     parent::__construct($options);
 }
Пример #5
0
 public function __construct($options = null)
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
     }
     $oModelUser = new Admin_Model_User();
     $oAllUser = $oModelUser->findUsers(array(3, 4));
     if (isset($oAllUser)) {
         $this->_aAllUser[0] = "-";
         foreach ($oAllUser as $oValue) {
             $this->_aAllUser[$oValue->id] = trim($oValue->first_name . " " . $oValue->last_name);
         }
     }
     $oModelNotificationType = new Admin_Model_NotificationType();
     $oAllNotificationType = $oModelNotificationType->getAll();
     if (isset($oAllNotificationType)) {
         foreach ($oAllNotificationType as $oValue) {
             $this->_aAllNotificationType[$oValue->id] = stripcslashes($oValue->name);
         }
     }
     $oModelNotificationPriority = new Admin_Model_NotificationPriority();
     $oAllNotificationPriority = $oModelNotificationPriority->getAll();
     if (isset($oAllNotificationPriority)) {
         foreach ($oAllNotificationPriority as $oValue) {
             $this->_aAllNotificationPriority[$oValue->id] = stripcslashes($oValue->name);
         }
     }
     $oModelNotificationStatus = new Admin_Model_NotificationStatus();
     $oAllNotificationStatus = $oModelNotificationStatus->getAll();
     if (isset($oAllNotificationStatus)) {
         foreach ($oAllNotificationStatus as $oValue) {
             $this->_aAllNotificationStatus[$oValue->id] = stripcslashes($oValue->name);
         }
     }
     $oModelNotificationCategory = new Admin_Model_NotificationCategory();
     $oAllNotificationCategory = $oModelNotificationCategory->getAll();
     if (isset($oAllNotificationCategory)) {
         foreach ($oAllNotificationCategory as $oValue) {
             $this->_aAllNotificationCategory[0] = "-";
             $this->_aAllNotificationCategory[$oValue->id] = stripcslashes($oValue->name);
         }
     }
     parent::__construct($options);
 }
Пример #6
0
 public function __construct($options = null)
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
     }
     $this->setAmount();
     if ($this->getAmount()) {
         $this->setMerchantId();
         $this->setTime();
         $this->setDescr();
         $this->setUrl();
         $this->setAuthKey1();
         $this->setHash();
         $this->setUserParam();
         $this->_bIsInit = true;
     }
     parent::__construct($options);
 }
Пример #7
0
 public function __construct($options = null)
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     $oModelUser = new Admin_Model_User();
     $oModelUserCategory = new Admin_Model_UserCategory();
     if ($this->_oAuth->hasIdentity()) {
         $this->_aUser = $oModelUser->findUser($this->_oAuth->getStorage()->read()->user_id);
     }
     $oChatUserRecipients = $oModelUser->findAskOnline();
     if (isset($oChatUserRecipients)) {
         foreach ($oChatUserRecipients as $oRow) {
             $aUserParam = $oModelUser->findUser($oRow->id);
             $this->_aChatUserRecipients[$oRow->id] = trim($aUserParam["first_name"] . " " . $aUserParam["last_name"]);
         }
     }
     $oAllCategory = $oModelUserCategory->getAll();
     if (isset($oAllCategory)) {
         foreach ($oAllCategory as $oRow) {
             $this->_aCategory[$oRow->id] = trim($oRow->name);
         }
     }
     parent::__construct($options);
 }
Пример #8
0
 public function __construct($config = array())
 {
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
     parent::__construct($config);
 }
Пример #9
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
 }
 public function preDispatch()
 {
     $oSuccessSession = new Zend_Session_Namespace("success");
     $nItemHash = $this->_request->getParam("new");
     if (isset($nItemHash)) {
         $oSuccessSession->bIsNew = $nItemHash;
     }
     $this->_oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
     if ($this->_oAuth->hasIdentity()) {
         $this->_nUserId = $this->_oAuth->getStorage()->read()->user_id;
         $this->_sRoleName = $this->_oAuth->getStorage()->read()->role_name;
         $this->_sSiteUrl = $this->_oAuth->getStorage()->read()->site_url;
     }
     if ($this->_oAuth->hasIdentity() && $this->_sSiteUrl != str_replace("/", "", $this->view->baseUrl())) {
         $this->_oAuth->clearIdentity();
     }
 }
Пример #11
0
 public function updatePassword($sOldPassword, $sNewPassword)
 {
     if (is_string($sOldPassword) && is_string($sNewPassword)) {
         $oAuth = AppCms2_Controller_Plugin_ModuleAuth::getInstance();
         $nUserId = $oAuth->getStorage()->read()->user_id;
         if (is_numeric($nUserId)) {
             $oRow = $this->find($nUserId)->current();
             if ($oRow instanceof Zend_Db_Table_Row_Abstract) {
                 if ($oRow->password != md5(md5($sOldPassword) . $oRow->salt)) {
                     return null;
                 }
                 $oRow->password = md5(md5($sNewPassword) . $oRow->salt);
                 return $oRow->save();
             }
         }
     }
     return null;
 }