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


PHP Auth::get_screen_name方法代码示例

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


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

示例1: action_change

 public function action_change()
 {
     //トークンの生成
     $this->action_csrf();
     //バリデーション定義
     $val = Validation::forge();
     $val->add('password', '「現在のパスワード」')->add_rule('required')->add_rule('min_length', 8)->add_rule('max_length', 12);
     $val->add('newpassword', '「新しいパスワード」または、「(新)パスワード再入力」')->add_rule('required')->add_rule('min_length', 8)->add_rule('max_length', 12);
     $this->action_category();
     if (Input::post()) {
         if (Security::check_token()) {
             if ($val->run()) {
                 $username = Auth::get_screen_name();
                 //現在のパスワード
                 $old_password = Input::post('password');
                 //新しいパスワード
                 $new_password = Input::post('newpassword');
                 //パスワードを変更するメソッド
                 Auth::change_password($old_password, $new_password, $username);
                 $this->message = 'パスワードが変更されました。';
                 $view = View::forge('changepass/ChangePass', $this->data);
                 $view->set_global('message', $this->message, false);
                 $view->set_global('error', $this->error, false);
             } else {
                 $this->error = $val->error();
                 $view = View::forge('changepass/ChangePass', $this->data);
                 $view->set_global('message', $this->message, false);
                 $view->set_global('error', $this->error, false);
             }
         } else {
             Profiler::mark('CSRF攻撃');
         }
     }
     return $view;
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:35,代码来源:changepass.php

示例2: action_login

 public function action_login()
 {
     if (Auth::check()) {
         Response::redirect('admin');
     }
     $val = Validation::forge();
     if (Input::method() == 'POST') {
         $val->add('email', 'Email or Username')->add_rule('required');
         $val->add('password', 'Password')->add_rule('required');
         if ($val->run()) {
             $auth = Auth::instance();
             // check the credentials. This assumes that you have the previous table created
             if (Auth::check() or $auth->login(Input::post('email'), Input::post('password'))) {
                 // credentials ok, go right in
                 $current_user = Model_User::find_by_username(Auth::get_screen_name());
                 Session::set_flash('success', e('Welcome, ' . $current_user->username));
                 Response::redirect('admin');
             } else {
                 $this->template->set_global('login_error', 'Fail');
             }
         }
     }
     $this->template->title = 'Login';
     $this->template->content = View::forge('admin/login', array('val' => $val), false);
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:25,代码来源:admin.php

示例3: action_testemail

 public function action_testemail()
 {
     // Create an instance
     if (Auth::check()) {
         $data['user_link'] = 'logout';
         $email = Auth::get_screen_name();
         $data['email'] = $email;
     } else {
         $data['user_link'] = 'login';
     }
     $email = Email::forge();
     // Set the from address
     $email->from('no-reply@pscms.local', 'pscms.local');
     // Set the to address
     $email->to('blueshift9@gmail.com', 'You');
     // Set a subject
     $email->subject('This is the subject');
     // Set multiple to addresses
     /*$email->to(array(
     			'example@mail.com',
     			'another@mail.com' => 'With a Name',
     		));*/
     // And set the body.
     $email->body('This is my message');
     try {
         $email->send();
     } catch (\EmailValidationFailedException $e) {
         // The validation failed
     } catch (\EmailSendingFailedException $e) {
         // The driver could not send the email
         exit('driver cant send mail');
     }
 }
开发者ID:blueshift9,项目名称:pscms,代码行数:33,代码来源:blog.php

示例4: action_login

 public function action_login()
 {
     // Already logged in
     Auth::check() and Response::redirect('admin');
     $val = Validation::forge();
     if (Input::method() == 'POST') {
         $val->add('email', 'ユーザ名')->add_rule('required');
         $val->add('password', 'パスワード')->add_rule('required');
         if ($val->run()) {
             $auth = Auth::instance();
             // check the credentials. This assumes that you have the previous table created
             if (Auth::check() or $auth->login(Input::post('email'), Input::post('password'))) {
                 // credentials ok, go right in
                 if (Config::get('auth.driver', 'Simpleauth') == 'Ormauth') {
                     $current_user = Model\Auth_User::find_by_username(Auth::get_screen_name());
                 } else {
                     $current_user = Model_User::find_by_username(Auth::get_screen_name());
                 }
                 Session::set_flash('success', e('ようこそ、' . $current_user->username . 'さん'));
                 Response::redirect('admin');
             } else {
                 $this->template->set_global('login_error', '失敗しました');
             }
         }
     }
     $this->template->title = 'ログイン';
     $this->template->content = View::forge('admin/login', array('val' => $val), false);
 }
开发者ID:sato5603,项目名称:fuelphp1st-2nd,代码行数:28,代码来源:admin.php

示例5: before

 public function before()
 {
     parent::before();
     !Auth::check() and Response::redirect('/auth/login');
     $this->current_user = Model_User::find_by_username(Auth::get_screen_name());
     $this->template->set_global('current_user', $this->current_user);
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:7,代码来源:setting.php

示例6: action_login

 /**
  * Действие для авторизации пользователя
  */
 public function action_login()
 {
     // Already logged in
     \Auth::check() and \Response::redirect('admin/articles');
     $val = \Validation::forge();
     if (\Input::method() == 'POST') {
         $val->add('email', 'Логин')->add_rule('required');
         $val->add('password', 'Пароль')->add_rule('required');
         if ($val->run()) {
             $auth = \Auth::instance();
             // check the credentials. This assumes that you have the previous table created
             if (\Auth::check() or $auth->login(\Input::post('email'), \Input::post('password'))) {
                 // credentials ok, go right in
                 if (\Config::get('auth.driver', 'Simpleauth') == 'Ormauth') {
                     $current_user = \Model\Auth_User::find_by_username(\Auth::get_screen_name());
                 } else {
                     $current_user = \Model_User::find_by_username(\Auth::get_screen_name());
                 }
                 \Session::set_flash('success', 'Добро пожаловать, <b>' . $current_user->username . '</b>');
                 \Response::redirect('admin/articles');
             } else {
                 \Session::set_flash('error', 'Неверная комбинация логина и пароля.');
             }
         }
     }
     $this->template->title = 'Авторизация';
     $this->template->content = \View::forge('login', array('val' => $val), false);
 }
开发者ID:alexmon1989,项目名称:fcssadon.ru,代码行数:31,代码来源:admin.php

示例7: before

 public function before()
 {
     parent::before();
     // Assign current_user to the instance so controllers can use it
     $this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
     // Set a global variable so views can use it
     View::set_global('current_user', $this->current_user);
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:8,代码来源:base.php

示例8: before

 public function before()
 {
     parent::before();
     // Without this line, templating won't work!
     if (\Auth::check()) {
         # Set user info
         list(, $userid) = \Auth::get_user_id();
         $this->template->set_global('auth', ['user' => ['screen_name' => \Auth::get_screen_name(), 'group' => \Auth::group()->get_name()]], false);
     }
 }
开发者ID:vano00,项目名称:jobs,代码行数:10,代码来源:base.php

示例9: action_registered

 public function action_registered()
 {
     $auth = Auth::instance();
     $user_id = Session::get_flash('ninjauth.user_id');
     if (isset($user_id)) {
         Auth::instance()->force_login($user_id);
         return Response::redirect('/user/' . Auth::get_screen_name());
     }
     return $this->response;
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:10,代码来源:auth.php

示例10: action_Delete

 public function action_Delete()
 {
     $check = Input::post('check');
     if ($check == '') {
         //何もしないで元に戻る
     } else {
         foreach ($check as $ck) {
             $query = DB::update('Galtuka')->set(array('df' => '1', 'luID' => Auth::get_screen_name()))->where('Did', '=', $ck)->execute();
         }
     }
     Response::redirect('department');
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:12,代码来源:departmentmanagement.php

示例11: post_setComment

 /**
  * setComment Method
  * 
  * @brief add comment by ajax
  */
 public function post_setComment()
 {
     $comment = Input::post('comment');
     $status = false;
     if (!empty($comment)) {
         $mongodb = \Mongo_Db::instance();
         $username = Auth::get_screen_name() ? Auth::get_screen_name() : 'guest';
         $insert_id = $mongodb->insert('comments', array('timestamp' => time(), 'name' => $username, 'comment' => $comment));
         $status = true;
     }
     $this->response(array('status' => $status, 'data' => $comment));
 }
开发者ID:raben,项目名称:analytics_old,代码行数:17,代码来源:data.php

示例12: before

 public function before()
 {
     parent::before();
     $this->viewer_info = array();
     if (!Auth::check()) {
         Response::redirect('members');
         // login画面に戻る。
     } else {
         $this->viewer_info['name'] = Auth::get_screen_name();
         $this->viewer_info['uid'] = Auth::get_user_id();
     }
 }
开发者ID:akmnhm,项目名称:tabi_log,代码行数:12,代码来源:top.php

示例13: before

 public function before()
 {
     parent::before();
     // Assign current_user to the instance so controllers can use it
     if (Config::get('auth.driver', 'Simpleauth') == 'Ormauth') {
         $this->current_user = Auth::check() ? Model\Auth_User::find_by_username(Auth::get_screen_name()) : null;
     } else {
         $this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
     }
     // Set a global variable so views can use it
     View::set_global('current_user', $this->current_user);
 }
开发者ID:vienbk91,项目名称:fuelphp17,代码行数:12,代码来源:base.php

示例14: before

 public function before()
 {
     parent::before();
     // Assign current_user to the instance so controllers can use it
     $this->current_user = Auth::check() ? Model_User::find_by_username(Auth::get_screen_name()) : null;
     // Set a global variable so views can use it
     View::set_global('current_user', $this->current_user);
     if ($this->current_user) {
         $this->status_where = array(array('status', '!=', null));
     } else {
         $this->status_where = array(array('status', self::STATUS_DISP));
     }
 }
开发者ID:nobuhiko,项目名称:mylogbook,代码行数:13,代码来源:base.php

示例15: before

 public function before()
 {
     parent::before();
     // Without this line, templating won't work!
     if (\Auth::check()) {
         // Check if the current user is an administrator
         if (!\Auth::member(100)) {
             \Session::set_flash('error', 'You don\'t have the required access');
             \Response::redirect('auth');
         }
         # Set user info
         $this->template->set_global('auth', ['user' => ['screen_name' => \Auth::get_screen_name(), 'group' => \Auth::group()->get_name()]], false);
     } else {
         \Response::redirect('auth');
     }
 }
开发者ID:vano00,项目名称:jobs,代码行数:16,代码来源:admin.php


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