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


PHP UserController::getUser方法代码示例

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


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

示例1: getUsersChat

 public static function getUsersChat($code)
 {
     $user = UserController::getUser(Auth::user());
     $sectionCodes = null;
     if ($user instanceof Teacher) {
         $sectionCodes = SectionCode::where('teacher_id', new MongoId($user->_id))->where('status', true)->where('code', $code)->first();
     } else {
         if ($user instanceof Student) {
             $sectionCodes = SectionCode::whereIn('students_id', array(new MongoId($user->_id)))->where('status', true)->where('code', $code)->first();
         }
     }
     return $sectionCodes;
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:13,代码来源:ChatController.php

示例2: resetPassword

 /**
  * Reset password for the student
  * 
  * @return View
  */
 public function resetPassword()
 {
     $user = User::first(['_id' => trim(Input::get('_id'))]);
     $user->password = Hash::make(Input::get('password'));
     $user->save();
     $info = UserController::getUser($user);
     $data = array('name' => strtoupper($info->name));
     Mail::send('emails.confirm-reset-password', $data, function ($message) {
         $message->to(strtolower(trim(Input::get('email'))))->subject(Lang::get('forget-password.reset_succes'));
     });
     $user = BlockedUser::where('user', $user->user)->first();
     if (isset($user->_id)) {
         $user->delete();
         if (Session::has($user->user)) {
             Session::forget($user->user);
         }
     }
     return Redirect::to('/')->with('message', Lang::get('register_student.password_changed'));
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:24,代码来源:UserController.php

示例3: UserController

if (isset($_POST['action'])) {
    // instantiate classes to call functions from
    $UserController = new UserController();
    $ProjectController = new ProjectController();
    $PageController = new PageController();
    // handle which function to call
    switch ($_POST['action']) {
        // User Methods
        case "createUser":
            $UserController->createUser();
            break;
        case "deleteUser":
            $UserController->deleteUser();
            break;
        case "getUser":
            $UserController->getUser();
            break;
        case "checkLoggedIn":
            $UserController->checkLoggedIn();
            break;
        case "isAdmin":
            $UserController->isAdmin();
            break;
        case "login":
            $UserController->login();
            break;
        case "logout":
            $UserController->logout();
            break;
            // Project Methods
        // Project Methods
开发者ID:ka05,项目名称:Webinator-New,代码行数:31,代码来源:dispatch.php

示例4:

$stats = MessageController::getStats();
?>
			<ul class="nav navbar-top-links navbar-right user-menu" id="user-menu">
				<li class="dropdown">
					<a href="#" class="settings dropdown-toggle" data-toggle="dropdown">
						<i class="fa fa-envelope" style="color: #0097A7;"></i>
						@if($stats['unread'] > 0)
							<span id="unread" class="badge bg-pink">{{$stats['unread']}}</span>
						@endif
					</a>
					<ul class="dropdown-menu inbox dropdown-user">
						@foreach($unreadMessages as $index => $message)
							<li class="popups" id="{{$index+1}}">
								<a>
									<?php 
$user = UserController::getUser(User::first($message->from));
?>

									@if($user->profile_image === null)
										<img src="images/140x140.png" class="avatar" alt="avatar"></td>
									@else
										<img src="{{Lang::get('show_image').'?src='.storage_path().$user->profile_image}}" class="avatar"/>
									@endif    
									<input type="hidden" id="id{{$index+1}}" value="{{$message->_id}}">
									<div>
										<span class="username">{{$user->name}}</span> 
										<span class="time pull-right"> 
											<i class="fa fa-clock-o"></i> 
											{{MessageController::getDate($message->sent_date)}}
										</span>
									</div>
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:31,代码来源:master.blade.php

示例5:

								<tr>
									<td>{{$key + 1}}</td>
									<td>{{$assignment->description}}</td>
									<td>{{MessageController::getDate($assignment->date_assigned)}}</td>
									<td>{{MessageController::getDate($assignment->deadline, false)}}</td>
									<td>
										<?php 
$user = User::first($assignment->assigned_to);
$user = UserController::getUser($user);
?>
										{{$user->name.' '.$user->last_name}}
									</td>
									<td>
										<?php 
$user = User::first($assignment->assigned_by);
$user = UserController::getUser($user);
?>
										{{$user->name.' '.$user->last_name}}
									</td>
									<td>{{$assignment->score}}</td>
									<td>{{$assignment->rated}}</td>
								</tr>
							@endforeach
						</tbody>
					</table>
				@else
					<p>{{Lang::get('teacher_master.activity')}}</p>
				@endif
			</div>
		</div>
	</div>
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:31,代码来源:home.blade.php

示例6: function

    if (Auth::guest()) {
        return Request::ajax() ? Response::make('Unauthorized', 401) : Redirect::guest('/');
    }
});
Route::filter('university', function () {
    if (!UserController::getUser(Auth::user()) instanceof University) {
        return Request::ajax() ? Response::make('Unauthorized', 401) : View::make('error.403');
    }
});
Route::filter('student', function () {
    if (!UserController::getUser(Auth::user()) instanceof Student) {
        return Request::ajax() ? Response::make('Unauthorized', 401) : View::make('error.403');
    }
});
Route::filter('teacher', function () {
    if (!UserController::getUser(Auth::user()) instanceof Teacher) {
        return Request::ajax() ? Response::make('Unauthorized', 401) : View::make('error.403');
    }
});
Route::filter('auth.basic', function () {
    return Auth::basic();
});
/*
|--------------------------------------------------------------------------
| Guest Filter
|--------------------------------------------------------------------------
|
| The "guest" filter is the counterpart of the authentication filters as
| it simply checks that the current user is not logged in. A redirect
| response will be issued if they are, which you may freely change.
|
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:31,代码来源:filters.php

示例7: searchOrigin

 /**
  * Checks whether the recipient isn't the same user
  * 
  * @param  $id MongoId
  * @return Boolean
  */
 public static function searchOrigin($id)
 {
     $message = UserController::getUser(Auth::user())->messages()->find($id);
     if ($message->from !== Auth::id()) {
         return true;
     } else {
         return null;
     }
 }
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:15,代码来源:MessageController.php


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