示例#1
0
文件: Auth.php 项目: eghojansu/web
 public static function update($data)
 {
     $author = Author::instance()->findByPK(self::data('id_author'))->get(1);
     $author->copyfrom('POST', function ($data) {
         return $data;
     });
     $data['password'] || ($author->password = null);
     $saved = $author->save();
     !$saved || self::login($author->cast(), $author->is_admin);
     return $saved;
 }
示例#2
0
 public function delete($moe)
 {
     $moe->send(array('result' => Author::instance()->findByPK($moe->get('GET.id'))->findByNotId_author(Auth::data('id_author'))->get(1)->delete()));
 }
示例#3
0
文件: Home.php 项目: eghojansu/web
 public function profile($moe, $params)
 {
     $this->pageTitle('Profile of ' . $params['username']);
     $moe->set('profile', Author::instance()->profile($params['username']));
     $moe->send('home/profile');
 }