Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.144.132.48
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp-test /
app /
Http /
Controllers /
Delete
Unzip
Name
Size
Permission
Date
Action
Auth
[ DIR ]
drwxr-xr-x
2018-12-04 21:08
AuthController.php
11.01
KB
-rw-r--r--
2021-03-17 19:17
ChatsController.php
3.72
KB
-rw-r--r--
2021-03-18 18:33
Controller.php
361
B
-rw-r--r--
2021-02-09 19:47
HomeController.php
454
B
-rw-r--r--
2021-02-23 11:55
RestController.php
3.46
KB
-rw-r--r--
2021-03-19 11:14
Save
Rename
<?php namespace App\Http\Controllers; use Illuminate\Routing\Controller as BaseController; use App\Http\Controllers\Controller; use DB; use Illuminate\Http\Request; use Illuminate\Mail\Message; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Password; use Illuminate\Support\Str; use Illuminate\Foundation\Auth\ResetsPasswords; use Illuminate\Contracts\Auth\PasswordBroker; use Illuminate\Validation\Factory; use Illuminate\Validation; use RedirectsUsers; use App\User; use Session; class AuthController extends BaseController { public function showIndex(Request $request) { return view('home',[ ]); } public function showLogin() { if (\Auth::check() AND Session::get('save_string')) { return Redirect::to('/save/?t='.Session::get('save_string')); } // show the form return view('login'); } public function doLogin() { // validate the info, create rules for the inputs $rules = array( 'email' => 'required|email', // make sure the email is an actual email 'password' => 'required|alphaNum|min:3' // password can only be alphanumeric and has to be greater than 3 characters ); // run the validation rules on the inputs from the form $validator = Validator::make(Input::all(), $rules); // if the validator fails, redirect back to the form if ($validator->fails()) { return Redirect::to('login') ->withErrors($validator) // send back all errors to the login form ->withInput(Input::except('password')); // send back the input (not the password) so that we can repopulate the form } else { // create our user data for the authentication $userdata = array( 'email' => Input::get('email'), 'password' => Input::get('password') ); // attempt to do the login if (Auth::attempt($userdata)) { return ''; /* if (Session::get('save_string')) { return Redirect::to('/save/?t='.Session::get('save_string')); } else { return Redirect::to('/'); }*/ } else { // validation not successful, send back to form return view('login', array('error'=>'Wrong email or password')); } } } /** * Display the form to request a password reset link. * * @return \Illuminate\Http\Response */ public function showLinkRequestForm() { return view('reset-password', array('error'=>'','message'=>'')); } /** * Send a reset link to the given user. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse */ public function sendResetLinkEmail(Request $request) { $error = $message = ''; //\Illuminate\Validation\validate($request, ['email' => 'required|email']); // We will send the password reset link to this user. Once we have attempted // to send the link, we will examine the response then see the message we // need to show to the user. Finally, we'll send out a proper response. $response = $this->broker()->sendResetLink( $request->only('email') ); $message = 'We have sent an email with instructions'; /* if ($response == Password::RESET_LINK_SENT) { $message = $this->sendResetLinkResponse($response); } else { $error = $this->sendResetLinkFailedResponse($request, $response); }*/ return view('reset-password', array('error'=>$error, 'message'=>$message)); } /** * Get the response for a successful password reset link. * * @param string $response * @return \Illuminate\Http\RedirectResponse */ protected function sendResetLinkResponse($response) { return back()->with('status', trans($response)); } /** * Get the response for a failed password reset link. * * @param \Illuminate\Http\Request * @param string $response * @return \Illuminate\Http\RedirectResponse */ protected function sendResetLinkFailedResponse(Request $request, $response) { return back()->withErrors( ['forgot' => trans($response)] ); } public function showRegister() { if (\Auth::check()) { return Redirect::to('/'); } return view('register', array('errors'=>'', 'message'=>'', 'name'=>'', 'email'=>'')); } public function doRegister() { if (\Auth::check()) { return Redirect::to('/'); } $message = ''; $arError = array(); if (!Input::get('name')) $arError[] = '"Name" field is required'; if (!Input::get('email')) $arError[] = '"Email" field is required'; if (!Input::get('password')) $arError[] = '"Password" field is required'; if (!Input::get('password_confirm')) $arError[] = '"Password confirm" field is required'; if (Input::get('password') AND Input::get('password_confirm') AND Input::get('password')!=Input::get('password_confirm')) $arError[] = 'Fields "Password" and "Password confirm" mismatch'; if (Input::get('email')) { $usr = DB::table('users')->where('email', Input::get('email'))->get(); if (!empty($usr) AND count($usr)>0) $arError[] = 'This "Email" already exists'; } if (empty($arError)) { $user_id = DB::table('users')->insertGetId([ 'name' => Input::get('name'), 'email' => Input::get('email'), 'password' => bcrypt(Input::get('password')), 'confirmed' => 'Y', 'active' => 'Y', 'created_at' => date("Y-m-d H:i:s"), ]); if (intval($user_id)>0) { $message = 'You were successfully registered'; } } // show the form return view('register', array('errors'=>$arError, 'message'=>$message, 'name'=>Input::get('name'), 'email'=>Input::get('email'))); } public function showProfile() { if (!\Auth::check()) { return Redirect::to('/'); } echo "dsfsdfh<pre>"; print_r(Input::get('profile_foto')); echo "</pre>"; $arError = $arErrorPas = array(); $user_country = $name = $email = $card_number = $message = $pas_message = ''; $countries = DB::table('country')->orderBy('name', 'asc')->get(); if (Input::get('save_profile')) { if (!Input::get('name')) $arError[] = '"Name" field is required'; if (!Input::get('country')) $arError[] = '"Country" field is required'; /* if (!empty(Input::get('profile_foto'))) { foreach (Input::get('profile_foto') as $foto) { echo "ccc<pre>"; print_r($foto); echo "</pre>"; } } */ if (empty($arError)) { DB::table('users')->where('id', \Auth::user()->id)->update([ 'name' => Input::get('name'), 'real_name' => Input::get('name'), 'country' => Input::get('country'), 'card' => Input::get('card'), 'updated_at' => date("Y-m-d H:i:s"), ]); $message = 'Profile successfully changed'; } } if (Input::get('save_password')) { //if (!Input::get('password_old')) $arErrorPas[] = '"Old Password" field is required'; if (!Input::get('password')) $arErrorPas[] = '"Password" field is required'; if (!Input::get('password_confirm')) $arErrorPas[] = '"Password confirm" field is required'; if (Input::get('password') AND Input::get('password_confirm') AND Input::get('password')!=Input::get('password_confirm')) $arErrorPas[] = 'Fields "Password" and "Password confirm" mismatch'; //$usr = DB::table('users')->where('id', \Auth::user()->id)->get(); //if ($usr[0]->password!=bcrypt(Input::get('password_old'))) $arErrorPas[] = 'Wrong "Old Password"'; if (empty($arErrorPas)) { DB::table('users')->update([ 'password' => bcrypt(Input::get('password')), 'updated_at' => date("Y-m-d H:i:s"), ]); $pas_message = 'Password successfully changed'; } } $usr = DB::table('users')->where('id', \Auth::user()->id)->get(); $user_country = $usr[0]->country; $name = $usr[0]->name; $email = $usr[0]->email; $card_number = $usr[0]->card; // show the form return view('profile', [ 'countries' => $countries, 'user_country' => $user_country, 'name' => $name, 'email' => $email, 'card_number' => $card_number, 'errors' => $arError, 'message' => $message, 'pas_errors' => $arErrorPas, 'pas_message' => $pas_message, ]); } /** * Get the password reset validation rules. * * @return array */ protected function rules() { return [ 'token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:6', ]; } /** * Get the password reset validation error messages. * * @return array */ protected function validationErrorMessages() { return []; } /** * Get the password reset credentials from the request. * * @param \Illuminate\Http\Request $request * @return array */ protected function credentials(Request $request) { return $request->only( 'email', 'password', 'password_confirmation', 'token' ); } /** * Reset the given user's password. * * @param \Illuminate\Contracts\Auth\CanResetPassword $user * @param string $password * @return void */ protected function resetPassword($user, $password) { $user->forceFill([ 'password' => bcrypt($password), 'remember_token' => Str::random(60), ])->save(); $this->guard()->login($user); } /** * Get the broker to be used during password reset. * * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker() { return Password::broker(); } /** * Get the guard to be used during password reset. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard() { return Auth::guard(); } public function doLogout() { Auth::logout(); return Redirect::to('login'); } }