コード例 #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $b = new \App\Model\Admin();
     $b->name = 'Mitul Patel';
     $b->username = '******';
     $b->email = '*****@*****.**';
     $b->password = bcrypt('admin');
     $b->jetKey = bcrypt($b->username);
     $b->save();
 }
コード例 #2
0
ファイル: auth.php プロジェクト: sahartak/v1poject
/**
 * 
 * @param type $uid
 * @param type $username
 * @param \uLogin $ulogin
 */
function appLogin($uid, $username, $ulogin){
	$_SESSION['admin']['adminid'] = $uid;
	$_SESSION['admin']['username'] = $username;
	$_SESSION['admin']['is_logged'] = true;
    
    $db = new \DBConnection();
    $adminModel = new \App\Model\Admin($db);
    $admin = $adminModel->getAdmin($uid);
    
    $_SESSION['admin']['refnum'] = $admin['ref'];
    $_SESSION['admin']['name']   = $admin['name'];
    $_SESSION['admin']['email']  = $admin['email'];
    $_SESSION['admin']['type']   = $admin['type'];
    
    addLog('Back-end', 'Login', ''.$admin['name'].' ('.$admin['ref'].')',''.$admin['name'].' ('.$admin['ref'].')','Successfully logged in');

	if (isset($_SESSION['appRememberMeRequested']) && ($_SESSION['appRememberMeRequested'] === true))
	{
		// Enable remember-me
		if ( !$ulogin->SetAutologin($username, true)) {
			echo "cannot enable autologin<br>";
        }

		unset($_SESSION['appRememberMeRequested']);
	}
	else
	{
		// Disable remember-me
		if ( !$ulogin->SetAutologin($username, false)) {
            echo 'cannot disable autologin<br>';
        }
	}
    
    page_header_simple();
    echo '<img src="../images/lploader.gif" border="0"><br /><b>System is loading, please wait...</b>';
    page_footer();
    exit();
}
コード例 #3
0
ファイル: routes.php プロジェクト: netxinyi/meigui
<?php

Route::bind('admins', function ($admin_id) {
    return App\Model\Admin::find($admin_id);
});
Route::model('user', 'App\\Model\\User');
Route::model('column', 'App\\Model\\Column');
Route::model('article', 'App\\Model\\Article');
Route::model('assembly', 'App\\Model\\Assembly');
Route::model('pastevents', 'App\\Model\\Pastevents');
Route::model('guestbook', 'App\\Model\\GuestBook');
Route::model('register', 'App\\Model\\Register');
Route::model('scase', 'App\\Model\\Scase');
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
|--------------------------------------------------------------------------
| 用户中心
|--------------------------------------------------------------------------
|
*/
Route::group(array('middleware' => 'auth'), function () {
    Route::controller('home', 'HomeController');