Esempio n. 1
0
 /**
  * 资料更新接口
  */
 public function update()
 {
     $model = new StoreModel();
     $data = I('post.');
     $data['store_logo'] = $_FILES['store_logo'];
     if (empty($_FILES['store_logo']) || $data['store_logo']['error'] == '4') {
         unset($data['store_logo']);
     }
     if (false === $model->myUpdate($data)) {
         $this->error($model->getError());
     }
     $this->success('更新成功', cookie(C('CURRENT_URL_NAME')));
 }
Esempio n. 2
0
 /**
  * store 修改密码 接口
  * @param string $org	原始密码
  * @param string $new	新密码
  * @param string $renew	确认新密码
  */
 public function chgPwd($org, $new, $renew)
 {
     if (empty($org) || empty($new)) {
         $this->error('密码不能为空');
     }
     if ($new !== $renew) {
         $this->error('新密码两次输入不一致');
     }
     $user_M = new StoreModel();
     if (false === $user_M->chgPwd($org, $new)) {
         $this->error($user_M->getError());
     }
     $this->success('密码修改成功!', U('Info/info'));
 }
 /**
  * 登录页面 , 登录提交接口
  * @param string $account 帐号
  * @param string $password 密码
  * @param string $verify 验证码
  */
 public function login($account = null, $password = null, $verify = null)
 {
     if (IS_POST) {
         //登录提交
         if (empty($account)) {
             $this->error('帐号错误!');
         } elseif (empty($password)) {
             $this->error('密码必须!');
         }
         /* 检测验证码
         			$verify = new Verify();
         			if (!$verify->check($code, 1)) {//验证码编号为1
         				$this->error('验证码输入错误!');
         			}
         			*/
         //验证用户
         $map = array();
         $map['account'] = $account;
         $map["status"] = 1;
         //-1:删除 0:禁用 1:正常
         $map['password'] = $password;
         $User = new StoreModel();
         if (!$User->login($map)) {
             $this->error($User->getError());
             //登录验证失败
         }
         $this->success('登录成功', U('Index/index'));
     } else {
         //登录页面
         if (is_login()) {
             $this->redirect('Index/index');
         } else {
             $this->display();
         }
     }
 }