Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::group(array('before' => 'mainheader'), function() {
- Route::get('adminlogin', 'AdminController@index');
- Route::post('postadminlogin', 'AdminController@postlogin');
- Route::get('adminforgotpassword', 'AdminController@forgotpassword');
- Route::post('adminsendpassword', 'AdminController@sendpassword');
- Route::get('adminresetforgotpassword', 'AdminController@resetforgotpassword');
- Route::post('postresetforgotpassword', 'AdminController@postresetforgotpassword');
- Route::group(array('before' => 'role'), function() {
- Route::get('admindashboard', 'UserController@dashboard');
- public function postlogin() {
- $input = Input::all();
- $password = $input['password'];
- $result = $this->admin->checklogin($input['email'], $password);
- if ($result == 1) {
- $ipaddress = Request::getClientIp();
- $this->admin->updatelastlogin($input['email'], $ipaddress);
- $adminuser = $this->admin->getbyemail($input['email']);
- Session::put('admin', $input['email']);
- Session::put('admintempname', $adminuser['name']);
- Session::put('admintype', $adminuser['admintype']);
- Session::put('previleges', $adminuser['previleges']);
- Session::put('logintype', 'admin');
- Session::put('asdf', 'qwer');
- $_SESSION["previleges"]=$adminuser['previleges'];
- $adminname = Session::get('admintempname');
- if ($adminname == "zoplay") {
- Session::put('adminname', 'demo');
- } else {
- Session::put('adminname', $adminname);
- }
- return Redirect::to('admindashboard');
- } else {
- Session::flash('failed', 'Invalid Username/Password');
- return Redirect::to('adminlogin');
- }
- }
- Route::filter('role', function() {
- if (Session::get('admin') == '') {
- return Redirect::to('adminlogin');
- }
- });
- public function dashboard() {
- //$requestcount = $this->request->getwaitingrequests();
- $alltasks = $this->task->getrecenttasks();
- $usercount = $this->user->getusercount();
- $taskercount = $this->user->gettaskercount();
- // $taskercount = $this->task->gettaskercount();
- $taskcount = $this->task->gettaskscount();
- $recenttaskers = $this->user->getrecenttaskers();
- $recentusers = $this->user->getrecentusers();
- $newusers = $this->user->getnewusers();
- return View::make('adminviews.dashboard', compact('taskcount', 'usercount', 'taskercount', 'alltasks', 'recenttaskers', 'recentusers', 'newusers'));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement