当前位置: 首页>>代码示例>>PHP>>正文


PHP Default_Model_Users::getEmpDetailsByEmailAddress方法代码示例

本文整理汇总了PHP中Default_Model_Users::getEmpDetailsByEmailAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP Default_Model_Users::getEmpDetailsByEmailAddress方法的具体用法?PHP Default_Model_Users::getEmpDetailsByEmailAddress怎么用?PHP Default_Model_Users::getEmpDetailsByEmailAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Default_Model_Users的用法示例。


在下文中一共展示了Default_Model_Users::getEmpDetailsByEmailAddress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendpasswordAction

 public function sendpasswordAction()
 {
     $ajaxContext = $this->_helper->getHelper('AjaxContext');
     $ajaxContext->addActionContext('sendpassword', 'json')->initContext();
     $emailaddress = $this->_request->getParam('emailaddress');
     $user = new Default_Model_Users();
     $result['result'] = '';
     $result['message'] = '';
     if ($emailaddress) {
         $isvalidemail = filter_var($emailaddress, FILTER_VALIDATE_EMAIL);
     }
     if ($emailaddress == '') {
         $result['result'] = 'error';
         $result['message'] = 'Please enter email.';
     } else {
         if ($emailaddress != $isvalidemail) {
             $result['result'] = 'error';
             $result['message'] = 'Please enter valid email.';
         } else {
             $emailexists = $user->getEmailAddressCount($emailaddress);
             $emailcount = $emailexists[0]['emailcount'];
             $username = $emailexists[0]['userfullname'];
             if ($emailcount > 0) {
                 $generatedPswd = uniqid();
                 $encodedPswd = md5($generatedPswd);
                 $user->updatePwd($encodedPswd, $emailaddress);
                 $options['subject'] = APPLICATION_NAME . ' Password Change';
                 $options['header'] = APPLICATION_NAME . ' Password';
                 $options['toName'] = $username;
                 $options['toEmail'] = $emailaddress;
                 $options['message'] = "<div>Hello " . $username . ",</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div>Your password for " . APPLICATION_NAME . " application has been changed. Following is the new password <b>" . $generatedPswd . "</b>.</div>";
                 $res = sapp_Mail::_email($options);
                 if ($res === true) {
                     $result['result'] = 'success';
                     $result['message'] = 'New password is sent to given E-mail';
                 } else {
                     $result['result'] = 'error';
                     $result['message'] = 'Problem sending email. Try again later.';
                 }
             } else {
                 $empdetailsbyemailaddress = $user->getEmpDetailsByEmailAddress($emailaddress);
                 if (!empty($empdetailsbyemailaddress)) {
                     $username = $empdetailsbyemailaddress[0]['userfullname'];
                     $status = $empdetailsbyemailaddress[0]['isactive'];
                     $isaccountlock = $empdetailsbyemailaddress[0]['emptemplock'];
                     if ($status == 0) {
                         $result['result'] = 'error';
                         $result['message'] = 'Employee has been inactivated from the organization.';
                     } else {
                         if ($status == 2) {
                             $result['result'] = 'error';
                             $result['message'] = 'Employee has resigned from the organization.';
                         } else {
                             if ($status == 3) {
                                 $result['result'] = 'error';
                                 $result['message'] = 'Employee has left the organization.';
                             } else {
                                 if ($status == 4) {
                                     $result['result'] = 'error';
                                     $result['message'] = 'Employee has been suspended from the organization.';
                                 } else {
                                     if ($status == 5) {
                                         $result['result'] = 'error';
                                         $result['message'] = 'Employee deleted.';
                                     } else {
                                         if ($isaccountlock == 1) {
                                             $result['result'] = 'error';
                                             $result['message'] = 'Employee has been locked.';
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 } else {
                     if ($emailcount == 0) {
                         $result['result'] = 'error';
                         $result['message'] = 'Email does not exist.';
                     }
                 }
             }
         }
     }
     $this->_helper->json($result);
 }
开发者ID:sura2k,项目名称:sentrifugo,代码行数:85,代码来源:IndexController.php


注:本文中的Default_Model_Users::getEmpDetailsByEmailAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。