public function usersignup() { $data = Input::all(); $rules = array('name' => 'min:2|alpha_dash', 'email' => 'required|unique:users', 'password' => 'required|min:4|confirmed', 'password_confirmation' => 'required|min:4'); $validator = Validator::make($data, $rules); if ($validator->fails()) { return Redirect::to('signup')->withInput()->withErrors($validator); } else { $user = new Users(); $user->email = $data['email']; $user->password = \Hash::make($data['password']); $user->priviliges = 3; $user->save(); $id = $user->id; Session::put('email', $user->email); $user_detail = new UserDetails(); $user_detail->name = $data['name']; $user_detail->email = $data['email']; $user_detail->contact = $data['contact']; $user_detail->id = $id; $user_detail->save(); $user = array("email" => $data['email'], "password" => $data['password']); if (\Auth::attempt($user)) { Session::put('email', $user['email']); Session::save(); } else { return Redirect::to('/'); } } }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { $user = new Users(array('name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'role' => $data['role'], 'photo' => $data['photo'])); $user->save(); $imageName = $user->id . '.' . $data['photo']->getClientOriginalExtension(); DB::table('users')->where('id', $user->id)->update(['image' => $imageName]); $data['photo']->move(base_path() . '/public/images/', $imageName); return $user; }
public function registerUser(Request $request) { $fullname = $request->get("fullname"); $username = $request->get("email"); $password = $request->get("password"); $user = new Users(); $user->fullname = $fullname; $user->username = $username; $user->password = Crypt::encrypt($password); $user->save(); return redirect('/'); }
public static function storeRegister($dataRegister, $token_active) { $registerUser = new Users(); $registerUser->user_name = $dataRegister['username']; $registerUser->email = $dataRegister['email']; $registerUser->password = Hash::make($dataRegister['password']); $registerUser->token_active = $token_active; $registerUser->active = 2; $registerUser->save(); if ($registerUser != null) { return true; } else { return false; } }
/** * GHet user by ID * * @return Response */ public function store() { /** * Création d'un utilisateurs + Création d'une room si pas de room ou alors complet */ // Remplissage des data, pour l'insertion $data = \Input::get('data'); $pseudoExist = \App\Users::where('pseudo', '=', $data['pseudo'])->count(); if ($pseudoExist >= 1) { return response()->json('Votre pseudo est déjà utiliser sur cette partie, veuillez saisir un autre pseudo', 200); } else { \App\Users::create($data); } // Dérnier inscris $users = \App\Users::orderBy('id', 'desc')->limit(1)->get(); /* Création d'une room */ $userRoom = \App\User_Room::count(); if ($userRoom == 0 || $userRoom == 5 || $userRoom == 10 || $userRoom == 15 || $userRoom == 20 || $userRoom == 25 || $userRoom == 30 || $userRoom == 35 || $userRoom == 40 || $userRoom == 45 || $userRoom == 50 || $userRoom == 55 || $userRoom == 60 || $userRoom == 65 || $userRoom == 70 || $userRoom == 75 || $userRoom == 80 || $userRoom == 85 || $userRoom == 90 || $userRoom == 95 || $userRoom == 100) { $room = new \App\Room(); $room->status = 1; $room->save(); } // dérniere Room $showRoom = \App\Room::orderBy('id', 'desc')->limit(1)->get(); /* Création des users sur une room */ $user_room = new \App\User_Room(); $user_room->id_users = $users[0]->id; $user_room->id_room = $showRoom[0]->id; $user_room->score; $user_room->gagner; $user_room->nbr_ligne; $user_room->save(); return response()->json('Création du joueur avec succès', 200); }
public function AddCard(Request $request) { $card = new BankCard(); $card = fill($request->all()); $card->save(); $user = Users::findOrFail($request->user_id); dd($request->name); }
protected function removeUnconfirmedUsers(Schedule $schedule) { $schedule->call(function () { $users = Users::where('is_confirmed', 'no')->where('time_created', '<=', date('Y-m-d h:i:s', strtotime("-1 days"))); foreach ($users as $user) { $user->delete(); } })->daily()->withoutOverlapping(); }
public function action_news() { if (Users::login()) { $user = Users::factory(); View::factory()->bind('email', $user->_email)->bind('name', $user->_fio)->response('news'); } else { $this->header('Location', URL); } }
public function update(Request $request, $id) { $data = $request->all(); $model = Users::find($id); autoAssignDataToProperty($model, $request->all()); $password = bcrypt($request->input('password')); $model->password = $password; $model->save(); return redirect(URL::previous())->withSuccess(Lang::get('messages.update_success')); }
public function authenticate(Request $request) { $this->validate($request, ['Email' => 'required|email', 'Password' => 'required']); $user = Users::where('Email', $request["Email"])->first(); if (isset($user) && Hash::check($user->Password, $request['Password'])) { return redirect('login')->withErrors(['users.nonexistent' => "Wrong Username or Password"]); } else { $request->session()->put('user', $user); return redirect('index'); } }
public function show($id) { $users = DB::table('users')->select('id', 'name', 'email', 'nombre')->where('id', '=', session('id'))->get(); Request::session()->has('id', $users[0]->id); $datos = $users[0]->id . $users[0]->nombre; $nombre = $users[0]->nombre; $email = $users[0]->email; $user = \App\Users::find($id); return view('maestro.grupos', compact('nombre', 'email', 'user')); return Helper::isLogged(); }
public function deleteUser($id) { $users = Users::where('id', $id)->first(); //->where('added_by', Session::get('id')); $path = public_path() . '/uploads/' . $users->added_by . '/' . $users->id; File::deleteDirectory($path); if ($users->delete()) { Flash::success('User deleted successfully.'); return redirect('/admin/users/manage'); } else { Flash::error('Failed to delete the user.'); return redirect('/admin/users/manage'); } }
public function show() { $users = DB::table('user')->count(); $tasks = DB::table('task')->count(); $count = DB::table('UserTask')->join('task', 'UserTask.id_task', '=', 'task.id')->where('UserTask.status', 'done')->select(DB::raw('sum(point) as point'))->get(); if (count($count) > 0) { $sum = $count[0]->point; } else { $sum = 0; } $querydone = DB::table('UserTask')->select(DB::raw('count(id_task) as done'))->where('status', 'done')->get(); if (count($querydone) > 0) { $countDone = (int) $querydone[0]->done; } else { $countDone = 0; } $users_list = \App\Users::orderBy('created_at', 'desc')->take(5)->get(); $rowsUsers = ""; foreach ($users_list as $user) { $rowsUsers .= '<tr class="gradeC userRow" id="' . $user->id . '"> <td class="userEmail"> ' . $user->email . ' </td> <td class="userLastName"> ' . $user->last_name . ' </td> <td class="center userFirstName"> ' . $user->first_name . ' </td> <td class="center userCity"> ' . $user->city . ' </td>'; } $tasks_list = \App\Task::orderBy('created_at', 'desc')->take(5)->get(); $rowsTask = ""; foreach ($tasks_list as $task) { $rowsTask .= '<tr class="gradeC taskRow" id="' . $task->id . '"> <td class="taskName"> ' . $task->name . ' </td> <td class="center userFirstName"> ' . $task->point . ' </td> <td class="center userStreet"> ' . $task->timer . ' </td></tr>'; } return View::make($this->_view, ['taskCount' => $tasks, 'userCount' => $users, 'usersScoreCount' => $count[0]->point, 'usersDoneCount' => $countDone, 'rowsUsers' => $rowsUsers, 'rowsTask' => $rowsTask, 'classMain' => 'active', 'classUsers' => '', 'classTasks' => '']); }
public function dologin() { $data = Request::all(); //return $data['password']; $email = $data['email']; $users = User::where('email', '=', $email)->get(); if ($users) { $status['message'] = "登陆"; $status['type'] = 1; Session::put('user', $users); Session::put('status', $status); return redirect('/success'); } else { $status['message'] = "登陆"; $status['type'] = 0; Session::put('status', $status); return redirect('/success'); } }
public function status(StatusRequest $requests) { if (Request::ajax()) { $action = $requests->input('action'); if ($action == 'delete') { $user = Users::find($requests->input('id')); $user->delete(); } if (!empty($action)) { $user = Users::find($requests->input('id')); if ($user->is_active == 'blocked') { $user->is_active = 'active'; } elseif ($user->is_active == 'active') { $user->is_active = 'blocked'; } $user->save(); } } }
public function typesPost(Request $request) { $this->validate($request, ['image' => 'required|mimes:jpg,png,jpeg', 'bill_type' => 'required']); $users = Users::where('id', Session::get('id'))->first(); if (Input::hasFile('image')) { $file = Input::file('image'); $destinationPath = public_path() . '/images/uploads/' . $users->added_by . '/' . $users->id; $filename = $file->getClientOriginalName(); $uploadSuccess = $file->move($destinationPath, $filename); } if ($uploadSuccess) { if ($request->bill_type == "thermal") { $json = file_get_contents('http://1000lookz.com:40001/bills/thermal?url=http://www.1000lookz.com/demo/sample/bills/thermal/2.jpg&isProcess=True&Range=10&Diff=10'); $obj = json_decode($json); } else { if ($request->bill_type == "invoice") { $json = file_get_contents('http://1000lookz.com:40001/bills/invoices?url=http://www.1000lookz.com/demo/sample/bills/invoices/3invoice.png&isProcess=True&Range=10&Diff=10'); $obj = json_decode($json); } else { if ($request->bill_type == "texture") { $json = file_get_contents('http://1000lookz.com:40001/bills/coloured?url=http://www.1000lookz.com/demo/sample/bills/color/1color.jpg&isProcess=True&Range=5&Diff=5'); $obj = json_decode($json); } else { if ($request->bill_type == "cheque") { $data = (string) Image::make($destinationPath . '/' . $filename)->fit(600, 600)->encode('data-url'); $ripped_data = preg_replace('#^data:image/[^;]+;base64,#', '', $data); $response = Curl::to('http://192.168.0.117:5000/test')->withData(array('data' => $ripped_data))->asJson()->post(); if (!empty($response->out)) { JavaScript::put(['img_data' => $response->out]); } /*$json = file_get_contents('http://192.168.0.117:5000/test?url=https://s3-ap-southeast-1.amazonaws.com/try1000looks.com/user_uploaded_pics/rotated.jpg'); $obj = json_decode($json);*/ return view("pages.user.chequeProcess", ["json_res" => $response]); } } } } return view("pages.user.displayResult", ["json_res" => $obj]); } else { return "Upload Failed"; } }
public function congo() { $userMaxId = Users::getUserMaxId(Auth::id()); $userMaxLevelName = Levels::getLevelName($userMaxId); if ($userMaxId >= 37) { return view('congo'); } else { return Redirect::to($userMaxLevelName[0]->levelName)->with('message', 'First Complete This Level!'); } }
public static function SetNotificationStatus($input) { $validation = Validator::make($input, Notifications::$NotifyRules); if ($validation->fails()) { return Response::json(array('status' => '0', 'msg' => $validation->getMessageBag()->first()), 200); } else { $access_token = $input['token']; $notification_id = $input['notification_id']; $current_time = new DateTime(); $user_id = Users::getUserIdByToken($access_token); if ($user_id) { $notification_data = DB::table('notification')->select('*')->where('id', $notification_id)->first(); if ($notification_data) { DB::table('notification')->where('id', $notification_id)->update(['is_read' => '1']); return Response::json(array('status' => '1', 'msg' => 'Notification Read'), 200); } else { return Response::json(array('status' => '0', 'msg' => 'Notification doesnot exists'), 200); } } else { return Response::json(array('status' => '0', 'msg' => "Token Expired"), 200); } } }
public static function getFriends() { $input = Input::all(); return Users::getFriends($input); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $users = Users::find($id); $users->delete(); Request::session()->flash('success', 'Delete successful!'); return redirect('admin/users'); }
$maxLevel = Users::getUserMaxLevel(Auth::id()); ?> <div class="navbar-fixed"> <nav> <div class="nav-wrapper"> <a href="/" class="brand-logo"><img src="/images/logo.jpg" class="logo-image"> Obscura</a> <a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a> <ul class="right hide-on-med-and-down"> <li><a class="waves-effect waves-light" href="/dashboard">Home</a></li> <li><a class="waves-effect waves-light" href="https://www.facebook.com/obscuranitkkr" target="_blank">Forum</a></li> <li><a class="waves-effect waves-light" href="/leaderboard">Leaderboard</a></li> <li><a class="dropdown-button" href="#!" data-activates="levels">Levels<i class="material-icons right">arrow_drop_down</i></a></li> <li><a class="dropdown-button" href="#!" data-activates="logout"><?php echo Users::getFirstName(Auth::id()); ?> <i class="material-icons right">arrow_drop_down</i></a></li> </ul> <ul id='logout' class='dropdown-content'> <li><a href="/logout">Logout</a></li> </ul> <ul id='levels' class='dropdown-content'> <?php $i = 0;
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $input = Input::all(); Users::create($input); return Redirect::route('users.index')->with('message', 'User created'); }
<input type="checkbox" name="value" value="1"<?=UserPrefs::get('p_hidediscord', $User->id)?' checked':''?> <?=!$sameUser?' disabled':''?>> <span>Hide Discord server link from the sidebar</span> <?php if ($sameUser){ ?> <button class="save typcn typcn-tick green" disabled>Save</button> <?php } ?> </label> </form> </section> <section class="sessions"> <h2><?=$sameUser? Users::PROFILE_SECTION_PRIVACY_LEVEL['staff']:''?>Sessions</h2> <?php if (isset($CurrentSession) || !empty($Sessions)){ ?> <p>Below is a list of all the browsers <?=$sameUser?"you've":'this user has'?> logged in from.</p> <ul class="session-list"><?php if (isset($CurrentSession)) Users::renderSessionLi($CurrentSession,CURRENT); if (!empty($Sessions)){ foreach ($Sessions as $s) Users::renderSessionLi($s); } ?></ul> <p><button class="typcn typcn-arrow-back yellow" id="signout-everywhere">Sign out everywhere</button></p> <?php } else { ?> <p><?=$sameUser?'You are':'This user is'?>n't logged in anywhere.</p> <?php } ?> </section> <?php } if ($sameUser){ if (Permission::sufficient('member') && Permission::insufficient('staff')){ ?> <section id="verify-discord-identity"> <h2><?=$sameUser? Users::PROFILE_SECTION_PRIVACY_LEVEL['private']:''?>Verify identity on Discord server</h2> <p>If you're not yet part of the Club Members role on our Discord server you can use an automated mechanism to verify your identity. Press the button below, and a command will be displayed which you just need to send to any text channel on the server to have your identity verified.</p>
<?php use App\CoreUtils; use App\Models\User; use App\Users; /** @var $title string */ ?> <div id="content"> <h1><?php echo $title; ?> </h1> <p>Originally made by <?php echo Users::get('dasprid', 'name', 'name, avatar_url')->getProfileLink(User::LINKFORMAT_FULL); ?> </p> <?php echo CoreUtils::notice('info', "<p><span class='typcn typcn-info-large'></span> This is a tool which helps you to find an original {$color}, given two different background {$color}s and the resulting blended {$color}, when the original {$color} is blended over it.</p><p><strong>Shift+Click</strong> an input to open a dialog where you can enter RGB values</p><a class='btn typcn typcn-arrow-back' href='/cg'>Back to {$Color} Guide</a>", true); ?> <div id="blend-wrap"> <form autocomplete="off"> <table> <thead> <tr> <th>Background</th> <th>Blended <?php echo $color; ?> </th> </tr>
public function getUserById($userId) { $result = Users::whereId($userId)->first(); return $result; }
static function getOverdueSubmissionList() { global $Database; $Query = $Database->rawQuery("SELECT reserved_by, COUNT(*) as cnt FROM (\n\t\t\t\tSELECT reserved_by FROM reservations\n\t\t\t\tWHERE deviation_id IS NOT NULL AND lock = false\n\t\t\t\tUNION ALL\n\t\t\t\tSELECT reserved_by FROM requests\n\t\t\t\tWHERE deviation_id IS NOT NULL AND lock = false\n\t\t\t) t\n\t\t\tGROUP BY reserved_by\n\t\t\tHAVING COUNT(*) >= 5\n\t\t\tORDER BY cnt DESC;"); if (empty($Query)) { return; } $HTML = "<table>"; foreach ($Query as $row) { $link = Users::get($row['reserved_by'])->getProfileLink(User::LINKFORMAT_FULL); $count = "<strong style='color:rgb(" . min(round($row['cnt'] / 10 * 255), 255) . ",0,0)'>{$row['cnt']}</strong>"; $HTML .= "<tr><td>{$link}</td><td>{$count}</td></tr>"; } return "{$HTML}</table>"; }
/** * Render log page <tbody> content * * @param $LogItems * * @return string */ static function getTbody($LogItems) { global $Database; $HTML = ''; if (count($LogItems) > 0) { foreach ($LogItems as $item) { if (!empty($item['initiator'])) { $inituser = Users::get($item['initiator'], 'id'); if (empty($inituser)) { $inituser = '******'; } else { $inituser = $inituser->getProfileLink(); } $ip = in_array($item['ip'], array('::1', '127.0.0.1')) ? "localhost" : $item['ip']; if ($item['ip'] === $_SERVER['REMOTE_ADDR']) { $ip .= ' <span class="self">(from your IP)</span>'; } } else { $inituser = null; $ip = '<a class="server-init" title="Search for all entries by Web server"><span class="typcn typcn-zoom"></span> Web server</a>'; } $event = Logs::$LOG_DESCRIPTION[$item['reftype']] ?? $item['reftype']; if (isset($item['refid'])) { $event = '<span class="expand-section typcn typcn-plus">' . $event . '</span>'; } $ts = Time::tag($item['timestamp'], Time::TAG_EXTENDED); if (!empty($inituser)) { $ip = "{$inituser}<br>{$ip}"; } $HTML .= <<<HTML \t\t<tr> \t\t\t<td class='entryid'>{$item['entryid']}</td> \t\t\t<td class='timestamp'>{$ts}</td> \t\t\t<td class='ip'>{$ip}</td> \t\t\t<td class='reftype'>{$event}</td> \t\t</tr> HTML; } } else { $HTML = '<tr><td colspan="4"><div class="notice info align-center"><label>No log items found</label></td></tr>'; } return $HTML; }
public function getAvailableManagerDetails($where) { try { $result = Users::whereRaw($where['rawQuery'], isset($where['bindParams']) ? $where['bindParams'] : array())->join('permission_user_relation', 'users.id', '=', 'permission_user_relation.user_id')->select(['id', 'username', 'email', 'created_at', 'updated_at', 'status'])->get(); return $result; } catch (\Exception $e) { return $e->getMessage(); } }
</div> <?php include_once 'footer.php'; ?> <script src="js/index.js"></script> <script> document.onkeydown = checkKey; var counter = 0; function checkKey(e) { e = e || window.event; if(e.keyCode == 16) { counter += 1; if(counter == 5) { alert("You did it."); var key = "key"; var value = 50; window.location = "/level4?key="+value; //window.location.pathname = "/level4?"+"key"+"="+vaue; } } } </script> <?php echo "<!--" . Users::getHintSource(3) . "-->"; ?> </body> </html>
public static function oath($email, $password) { $p = DB::query()->select('password', 'id')->from('user')->where('email', '=', $email)->and_where('`check-e`', '=', 1)->execute()->current(); if ($p === false) { return false; } $data = unserialize($p['password']); $user = new Users(); if ($user->hash_check($password, $data['hash'], $data['salt'])) { STD::set_cookie('rememberme', $p['id']); return true; } return false; }