Exemplo n.º 1
0
 public function handle_request_internal()
 {
     if (!$this->isBrokerLogin()) {
         $this->redirect_to_login();
     }
     $objRequest = APF::get_instance()->get_request();
     $action = $objRequest->get_parameter("action");
     $old_pass = $objRequest->get_parameter("old_pass");
     $new_pass1 = $objRequest->get_parameter("new_pass1");
     $new_pass2 = $objRequest->get_parameter("new_pass2");
     $new_pass1Length = strlen($new_pass1);
     if ($new_pass1Length < 6 || $new_pass1Length > 16) {
         $updateSuccess = false;
         $objRequest->set_attribute("updateSuccess", $updateSuccess);
         return "Broker_ModifyPassword";
     }
     if (preg_match("/[\\u4e00-\\u9fa5]/i", $new_pass1) || preg_match("/['\"&<>\\s]/i", $new_pass1)) {
         $updateSuccess = false;
         $objRequest->set_attribute("updateSuccess", $updateSuccess);
         return "Broker_ModifyPassword";
     }
     if ($new_pass1 != $new_pass2) {
         $updateSuccess = false;
         $objRequest->set_attribute("updateSuccess", $updateSuccess);
         return "Broker_ModifyPassword";
     }
     //提交表单
     if ($action == "modifypasswd") {
         $md5_password = md5($old_pass);
         $baseencode_password = base64_encode($md5_password);
         $md5_passwordnew = md5($new_pass1);
         $baseencode_passwordnew = base64_encode($md5_passwordnew);
         $uid = $objRequest->getUserId();
         $objORM = new ORM_AnjukeORM('ajk_members');
         $sql = "select UserId from ajk_members where UserId='" . $uid . "' and UserPwd='{$baseencode_password}'";
         $rst = $objORM->executeSQL($sql);
         if (count($rst)) {
             if ($uid) {
                 $aff_row = $objORM->executeSQL("update ajk_members set UserPwd='{$baseencode_passwordnew}' where UserId='{$uid}'");
                 if ($aff_row == 1 || $baseencode_password == $baseencode_passwordnew) {
                     $updateSuccess = true;
                 }
             }
         } else {
             $updateSuccess = false;
         }
     }
     $objRequest->set_attribute("url", $this->getURL('my', '/ajkbroker/broker/brokerinfo'));
     $objRequest->set_attribute("updateSuccess", $updateSuccess);
     return "Broker_ModifyPassword";
 }
Exemplo n.º 2
0
 public static function chkShopOpenByBrokerID($p_intBrokerID)
 {
     $objORM = new ORM_AnjukeORM('shop_list');
     $strSQL = 'select IsOpen from shop_list where BrokerId = ?';
     $arrData = $objORM->executeSQL($strSQL, array($p_intBrokerID), 'ONE');
     return !empty($arrData) ? $arrData['IsOpen'] : null;
 }
Exemplo n.º 3
0
 public static function getLastPostBnsCardFile($bid)
 {
     if (!$bid) {
         return false;
     }
     $objORM = new ORM_AnjukeORM("ajk_broker_updatedata");
     $sql = "select Daid,CityId, AreaCode, CommpStore, UserMobile, UserPhone, FileName, IsPass, StoreId from ajk_broker_updatedata where BrokerId='{$bid}' order by PostTime desc limit 1 ";
     $rst = $objORM->executeSQL($sql);
     return $rst[0];
 }
Exemplo n.º 4
0
 static function createAccountMappingDao($data = array())
 {
     $orm = new ORM_AnjukeORM('account_mapping');
     $sqlFields = "";
     $sqlValue = "";
     $sqlUpdate = "";
     foreach ($data as $field => $value) {
         $sqlFields .= " " . $field . ",";
         $sqlValue .= " " . $value . ",";
         if ($field != "USERID") {
             $sqlUpdate .= $field . "=" . $value . ",";
         }
     }
     $sqlUpdate = rtrim($sqlUpdate, ",");
     $sql = "INSERT INTO account_mapping(" . $sqlFields . "LAST_UPDATE) VALUES (" . $sqlValue . "'" . date("Y-m-d H:i:s") . "')   ON DUPLICATE KEY UPDATE " . $sqlUpdate;
     $result = $orm->executeSQL($sql);
     if ($result || $result === "0") {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 5
0
 public function addUpdateBrokerData($arr)
 {
     $objORM = new ORM_AnjukeORM('ajk_broker_updatedata');
     $timestamp = $this->time;
     $sql = "insert into ajk_broker_updatedata (BrokerId,CityId,AreaCode,CommpStore,UserPhone,FileName,PostTime,CompanyId,StoreId) values('" . $arr['BrokerId'] . "','" . $arr['CityId'] . "','" . $arr['AreaCode'] . "','" . $arr['CommpStore'] . "','" . $arr['UserPhone'] . "','" . $arr['FileName'] . "','{$timestamp}','" . $arr['CompanyId'] . "','" . $arr['StoreId'] . "')";
     $rst = $objORM->executeSQL($sql);
     return $rst;
 }
Exemplo n.º 6
0
 /**
  * 更新点击过分类内容的人数
  * @param $p_intID
  * @return mixed
  */
 public function updHelpTreeByID($p_intID)
 {
     $objORM = new ORM_AnjukeORM('ajk_helptree');
     $p_strCondition = "update ajk_helptree set joinnum = joinnum + 1 where Id = " . $p_intID;
     return $objORM->executeSQL($p_strCondition);
 }
Exemplo n.º 7
0
 public static function updateActivityCentre($ActivityId)
 {
     $objORM = new ORM_AnjukeORM('ajk_activity');
     $strSql = "update ajk_activity set JoinNumber = JoinNumber + 1 where ID = " . $ActivityId;
     return $objORM->executeSQL($strSql);
 }