userAction.php 925 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. class userClassAction extends apiAction
  3. {
  4. public function editpassAction()
  5. {
  6. if(getconfig('systype')=='demo')$this->showreturn('演示上不要修改');
  7. $id = $this->adminid;
  8. $oldpass = $this->post('passoldPost');
  9. $pasword = $this->post('passwordPost');
  10. $msg = m('login')->editpass($id, $oldpass, $pasword);
  11. if($msg=='success'){
  12. $this->showreturn('success');
  13. }else{
  14. $this->showreturn('',$msg, 201);
  15. }
  16. }
  17. //修改头像
  18. public function editfaceAction()
  19. {
  20. $fid = (int)$this->post('fid');
  21. $dbs = m('admin');
  22. $face= $dbs->changeface($this->adminid, $fid);
  23. if($face)$face = $dbs->getface($face);
  24. $this->showreturn($face);
  25. }
  26. //设置极光推送的regid
  27. public function setjpushidAction()
  28. {
  29. $id = $this->get('id');
  30. m('login')->update("`ip`='$id'", "`token`='$this->token' and `uid`='$this->adminid'");
  31. $this->showreturn('ok');
  32. }
  33. }
粤ICP备19079148号