public function index() { $cvId = DB::table('CV')->where('employeeId', \Session::get('employeeId'))->select('employeeId')->get(); if ($cvId) { \session::flash('cvId', $cvId); } return \View::make("index"); }
public function habilitarupdate(Request $request) { $habilitar = HabilitarEvaluacion::find(1); $habilitar->fill($request->only(['estado'])); $habilitar->save(); session::flash('message', 'Evaluacion editada'); //,array($bios->id) return redirect()->route('evaluacion.index'); }
public function removeGateway($id) { if (!\Auth::user()->isAdmin()) { return back()->withErrors(['You have no permissions to remove gateway.']); } $gateway = Gateway::findOrFail($id); $gateway->delete(); session::flash('message', 'Gateway removed.'); return back(); }
/** * Init the flash instance */ public static function initFlash() { if (self::$flash) return; self::$flash = self::getInstance(array( 'prefix'=>'flash', 'nameSpace'=>'flash', )); self::$flashVars = self::$flash->getAll(); self::$flash->clear(); }
/** * Alert Activate function * * Triggers the alert box if a session is set on alert */ public static function activate() { if (Session::exists('alert')) { $alertRawData = session::flash('alert'); $alertData = explode(',', $alertRawData); if (count($alertData) === 3) { $data['eventType'] = $alertData[0]; $data['alertTitle'] = $alertData[1]; $data['alertMessage'] = $alertData[2]; require_once APPPATH . 'views/alerts/alertMain.html.php'; } } }
require_once '/opt/lampp/htdocs/MySpace/src/init.php'; $user = new user(); //echo $user->data()->node_id; if (!$user->isLoggedIn()) { redirect::to('index.php'); } if (input::exists()) { if (token::check(input::get('token'))) { //echo $user->data()->node_id; $validate = new validation(); $validation = $validate->check($_POST, array('FirstName' => array('required' => true, 'min' => 2, 'max' => 20), 'LastName' => array('required' => true, 'min' => 2, 'max' => 20), 'CurrentTown' => array('required' => true, 'min' => 2, 'max' => 20), 'Hometown' => array('required' => true, 'min' => 2, 'max' => 20))); if ($validation->passed()) { try { $user->update(array('FirstName' => input::get('FirstName'), 'LastName' => input::get('LastName'), 'CurrentTown' => input::get('CurrentTown'), 'Hometown' => input::get('Hometown'))); session::flash('home', 'Your details have been updated!!'); redirect::to('index.php'); } catch (Exception $e) { die($e->getMessage()); } } else { foreach ($validation->errors() as $error) { echo $error, '<br>'; } } } } ?> <!DOCTYPE Funspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <link href="<?php echo 'register.css';
echo escape($comment[1]->CommentedBy); ?> "><?php echo escape($comment[1]->CommentedBy); ?> </a> <?php } } } if (input::exists()) { $comment = input::get('text' . $post->PostID); if ($comment != null) { if ($user->WrtieComment($user->data()->UserID, $post->PostID, $comment)) { session::flash('home', 'Comment added'); redirect::to('index.php'); } } $like = input::get('like' . $post->PostID); if ($user->Like($user->data()->UserID, $post->PostID)) { //session::flash ( 'home', 'Post liked!' ); redirect::to('index.php'); } } } ?> <p>Special Query to see list of comments you've commented</p> <?php if ($user->SpecialQuery($user->data()->UserID)) { foreach ($user->special1() as $special) {
if (!$user2->exist()) { session::flash('error', 'The user does not exist!'); Redirect::to(path . 'index.php'); } } if (Input::exists()) { if (Token::check(Input::get('token'))) { $validate = new Validation(); $validate->check($_POST, array('id' => array('required' => true), 'name' => array('required' => true), 'username' => array('required' => true, 'min' => 2, 'max' => 15), 'group' => array('required' => true))); if ($validate->passed()) { try { $user2->update(Input::get('name'), Input::get('group'), Input::get('username'), Input::get('id')); session::flash('complete', 'You updated ' . Input::get('name') . ' details!'); Redirect::to(path . 'index.php'); } catch (Exception $e) { session::flash('error', 'There was an error updating the user ' . Input::get('name') . ' with the message of ' . $e->getMessage() . '(' . $e->getCode() . ')'); } } } } ?> <html> <head> <?php include path . 'assets/php/css.php'; ?> </head> <body> <?php include path . 'assets/php/nav.php'; ?>
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $subirwod = SubirWod::findOrFail($id); $subirwod->delete(); session::flash('message', ' eliminado de los registros'); return redirect()->route('admin.subirwod.index'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id, Request $request) { $users = User::findOrFail($id); $users->delete(); session::flash('message', 'Usuario eliminado de los registros'); return redirect()->route('admin.users.index'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $woddiario = WodDiario::findOrfail($id); $woddiario->delete(); session::flash('message', 'WOD eliminado'); return redirect()->route('admin.woddiario.index'); }
if (Token::check(Input::get('token'))) { $val = new Validation(); $val->check($_POST, array('name' => array('required' => true), 'username' => array('required' => true, 'min' => 2, 'max' => 50, 'unique' => 'users'), 'email' => array('required' => true, 'unique' => 'users'), 'password' => array('required' => true, 'min' => 8), 'password_conf' => array('required' => true, 'matches' => 'password'))); if (!$val->passed()) { } else { $user = new User(); $salt = hash::salt(32); $password = hash::make(escape(Input::get('password')), $salt); try { $user->create(array('username' => escape(Input::get('username')), 'password' => Hash::make(escape(Input::get('password')), $salt), 'salt' => $salt, 'name' => escape(Input::get('name')), 'joined' => date('Y-m-d- H:i:s'), 'group' => 1, 'email' => escape(Input::get('email')))); } catch (Exception $e) { die($e->getMessage()); } if ($user->login(escape(Input::get('username')), escape(Input::get('password')), false)) { Notifaction::createMessage('Welcome to the forums ' . $user->data()->name, $user->data()->id); session::flash('complete', 'You completely register and you just got logged in.'); Redirect::to('/'); } } } } ?> <html> <head> <?php include 'inc/templates/head.php'; ?> </head> <body> <?php include 'inc/templates/nav.php';
require_once '/opt/lampp/htdocs/MySpace/src/init.php'; $user = new user(); if (!$user->isLoggedIn()) { redirect::to('index.php'); } if (input::exists()) { if (token::check(input::get('token'))) { $validate = new validation(); $validation = $validate->check($_POST, array('Password' => array('required' => true, 'min' => 8), 'Npassword' => array('required' => true, 'min' => 8), 'Rpassword' => array('required' => true, 'min' => 8, 'matches' => 'Npassword'))); if ($validation->passed()) { if (hash::make(input::get('Password')) !== $user->data()->Password) { echo 'your old password did not match'; } else { if ($user->update(array('Password' => hash::make(input::get('Npassword'))))) { session::flash('home', 'Your password have been updated!!'); redirect::to('index.php'); } } } } } ?> <link href="<?php echo 'register.css'; ?> " rel='stylesheet' type='text/css'> <form action="" method="post"> <div class="field"> <label id="icon" for="Password"><i class="icon-shield"></i></label> <input type="Password" name="Password" id="Password" placeholder="CurrentPassword" required/>
<?php if (Input::exists()) { if (Token::check(Input::get('token'))) { $val = new Validation(); $validation = $val->check($_POST, array('oldPassword' => array('required' => true), 'newPassword' => array('required' => true, 'min' => 8), 'password_conf' => array('required' => true, 'matches' => 'newPassword'))); if ($validation->passed()) { if (Hash::make(escape(Input::get('oldPassword')), $user->data()->salt) == $user->data()->password) { } $newPass = Hash::make(escape(Input::get('newPassword')), $user->data()->salt); try { $user->update(array('password' => $newPass), $user->data()->id); session::flash('complete', 'You have changed your password!'); Redirect::to(''); } catch (Exception $e) { Session::flash('error', $e->getMessage()); Redirect::to(''); } } } } ?> <form action="" method="post"> <div class="form-group"> <input type="password" name="oldPassword" placeholder="Old Password" class="form-control input-lg"> </div> <div class="form-group"> <input type="password" name="newPassword" placeholder="New Password" class="form-control input-lg"> </div> <div class="form-group"> <input type="password" name="password_conf" placeholder="Password Confirm" class="form-control input-lg">
$validate = new validate(); $validation = $validate->check($_POST, array('Password' => array('required' => true, 'min' => 6), 'password_again' => array('required' => true, 'matches' => 'Password'))); if ($validation->passed()) { //session::flash('success','You registered successfully!'); //header('Location: index.php'); $user = new user(null, $_log); $salt = hash::salt(32); if ($data = $_db->get('Users', array('Username', '=', $username))) { //var_dump($data); if ($data->counts() > 0) { if ($data->first()->User_Verified == 0) { if ($data->first()->Confirm_Hash == $confirmCode) { $oldUser = $data->first()->Old_User; try { $user->updateUser(array('Password' => hash::make(input::get('Password'), $salt), 'Salt' => $salt, 'User_Verified' => 1, 'Confirm_Hash' => null, 'Old_User' => null), $_GET['Username']); session::flash('home', 'Your password has been created'); $_log->info('Username verified: ' . $username); // Will be logged if ($oldUser !== null) { try { if ($user->delete($oldUser)) { $_log->info('Old user deleted: ' . (string) $oldUser); } else { $_log->warning('Old user NOT deleted: ' . (string) $oldUser); } } catch (Exception $e) { var_dump($e->getMessage()); $_log->info($e->getMessage()); die($e->getMessage()); } }
<?php define('path', '../../../'); require path . 'inc/init.php'; $user = new User(); $blog = new Blog(); if (!$user->hasPermission('Admin')) { Session::flash('error', 'You must have delete to proform that!'); Redirect::to(path . 'index.php'); } if (Input::exists('get')) { if (Input::get('c') == null) { session::flash('error', 'You have to have the id of the cat you want to delete!'); Redirect::to(path . 'index.php'); } else { $c = escape(Input::get('c')); } if (!$blog->getCat($c)) { Session::flash('error', 'The cat has to be valid!'); Redirect::to(path . 'index.php'); } $oldCat = $blog->getCat($c); $blog->deleteCat(Input::get('c')); session::flash('complete', 'You have deleted the cat ' . $c->name); Redirect::to(path . 'index.php'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $tipopago = Tipopago::findOrFail($id); $tipopago->delete(); session::flash('message', 'tipopago eliminado de los registros'); return redirect()->route('admin.pago.index'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $noticia = Noticia::findOrFail($id); $noticia->delete(); session::flash('message', 'Noticia eliminado de los registros'); return redirect()->route('admin.noticia.index'); }
<?php $user = new User(); $forums = new Forums(); if (!$cat && !$post_id) { session::flash('error', 'There was no valid page! You have been taken back to the homepage!'); Redirect::to('/'); } $post = $forums->getPost($cat, $post_id); $post = $post[0]; $author = new User($post->post_user); ?> <html> <head> <?php include 'inc/templates/head.php'; ?> </head> <body> <?php include 'inc/templates/nav.php'; ?> <?php if (Session::exists('error')) { ?> <div class="alert alert-danger"><?php echo Session::flash('error'); ?> </div> <?php }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { \App\Proyecto::destroy($id); session::flash('message', 'Usuario Eliminado Correctamente'); return Redirect::to('/proyecto'); }
if (Input::exists('get')) { if (Input::get('id') != null && Input::get('a') != null) { if (Input::get('a') == 'read' && Input::get('val') != null) { if (!$db->query('UPDATE `notification` SET `read` =' . Input::get('val') . ' WHERE id =' . Input::get('id'))->error()) { Session::flash('complete', 'You marked it as read!'); Redirect::to('?page=notification'); } else { session::flash('error', 'there been an error marking this as read!'); Redirect::to('?page=notification'); } } elseif (Input::get('a') == 'delete') { if ($db->delete('notification', array('id', '=', Input::get('id')))) { Session::flash('complete', 'You deleted a message'); Redirect::to('?page=notification'); } else { session::flash('error', 'there been an error deleting this message!'); Redirect::to('?page=notification'); } } } } ?> <table class="table"> <thead> <tr> <td> ID </td> <td> Message </td>
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { \App\Tarea::destroy($id); session::flash('message', 'Tarea Eiminada Correctamente'); return Redirect::to('/tarea'); }
public function destroy($id) { $wodfijo = WodFijo::findOrfail($id); $wodfijo->delete(); session::flash('message', 'WOD eliminado'); return redirect()->route('wodfijo.index'); }
id="Password" placeholder="Email Address" autocomplete="off" required /> <div class="field"></div> ` <input type="hidden" name="token" value="<?php echo token::generate(); ?> "> <input type="submit" value="Login"> </form> </div> <?php if (session::exists('home')) { echo '<p>' . session::flash('home') . '</p>'; } $user = new user(); if ($user->isLoggedIn()) { redirect::to('index.php'); } else { if (input::exists()) { if (token::check(input::get('token'))) { $validate = new validation(); $validation = $validate->check($_POST, array('UserID' => array('required' => true), 'emailAddr' => array('required' => true))); if ($validation->passed()) { $user = new user(); $id = $user->find(input::get('UserID')); $newobj = new user($id); if ($newobj->find(input::get('UserID')) && $newobj->data()->EmailAddress) { ?>
<?php define('path', '../../../'); include path . 'inc/init.php'; $page = "admin"; $user = new User(); $blog = new Blog(); $val = new Validation(); if ($user->isLoggedIn() && $user->hasPermission('delete')) { if (input::exists()) { if (Token::check(input::get('token'))) { $val->check($_POST, array('ConfirmDel' => array('required' => true), 'post_id' => array('required' => true))); if ($val->passed()) { $blog->deletePost(Input::get('post_id')); session::flash('complete', 'You have deleted a post!'); Redirect::to(path . 'index.php'); } } } } ?> <html> <head> <?php include path . 'assets/php/css.php'; ?> </head> <body> <?php include path . 'assets/php/nav.php'; ?>
$user = new user(null, $_log); if (!$user->isLoggedIn() || !$user->hasPermission('Admin')) { redirect::to('../index.php'); } if (input::exists()) { if (token::check(input::get('token'))) { $validate = new validate(); $validation = $validate->check($_POST, array('Username' => array('required' => true, 'min' => 2, 'max' => 20, 'unique' => 'Users'), 'Password' => array('required' => true, 'min' => 6), 'password_again' => array('required' => true, 'matches' => 'Password'), 'Name' => array('required' => true, 'min' => 2, 'max' => 50))); if ($validation->passed()) { //session::flash('success','You registered successfully!'); //header('Location: index.php'); $user = new user(null, $_log); $salt = hash::salt(32); try { $user->create(array('Username' => input::get('Username'), 'User_Group' => 3, 'Password' => hash::make(input::get('Password'), $salt), 'Salt' => $salt)); session::flash('home', 'You have been registered'); redirect::to('index.php'); } catch (Exception $e) { //echo $e->getMessage(), '<br>'; die($e->getMessage()); } } else { foreach ($validation->errors() as $error) { echo $error, '<br>'; } } } } ?> <!DOCTYPE html>
<?php define("path", "../../../"); include path . 'inc/init.php'; $page = "Admin"; $user = new User(); if (!$user->hasPermission("Admin")) { session::flash("error", "You dont have admin permission! If you think this is an error contact your administrator or owner!"); Redirect::to(path . "index.php"); } ?> <html> <head> <?php include path . 'assets/php/css.php'; ?> </head> <body> <?php include path . 'assets/php/nav.php'; ?> <div class="container"> <div class="jumbotron"> <h1>Welcome back</h1> <h3><?php echo escape($user->data()->name); ?> </h3> </div> <div class="col-md-9"> <h3>Navigation</h3>
Redirect::to('/'); } if (Input::get('c') == null) { session::flash('error', 'you don\'t have the proper link'); Redirect::to('/admin'); } if (Input::exists()) { if (Token::check(Input::get('token'))) { $val = new Validation(); $validation = $val->check($_POST, array('title' => array('required' => true))); if ($validation->passed()) { $db = DB::getInstance(); $parent = Input::get('cat_par') == "NULL" ? null : Input::get('cat_par'); $update = $db->update('cat', Input::get('c'), array('name' => escape(Input::get('title')), 'parent' => $parent)); if ($update) { session::flash('complete', 'You have updated the category'); Redirect::to('/admin'); } } } } ?> <html> <head> <?php require 'inc/templates/head.php'; ?> </head> <body> <?php require 'inc/templates/nav.php';
if (!$user->isLoggedIn()) { Session::flash('error', 'It seems you are not logged in!'); Redirect::to('/'); } $db = DB::getInstance(); $q = $db->get('post', array('id', '=', escape($post_id)))->first(); if (Input::exists()) { if (Input::get('Submit')) { if (Token::check(Input::get('token'))) { $val = new Validation(); $validate = $val->check($_POST, array('title' => array('required' => true), 'content' => array('required' => true))); if ($validate->passed()) { try { $forums->createReply(array('title' => escape(Input::get('title')), 'post_id' => escape($post_id), 'content' => Input::get('content'), 'date' => date('Y-m-d- H:i:s'), 'user_id' => $user->data()->id)); Notifaction::createMessage($user->data()->username . ' posted a reply on your page', $forums->getPost2($post_id)->post_user); session::flash('complete', 'You posted your reply!'); Redirect::to('/forums/view/' . $cat . '/' . $post_id); } catch (Exception $e) { die($e->getMessage()); } } else { echo 'val not passed'; } } else { die('token failed'); } } else { die('submit'); } } ?>
if (Token::check(Input::get('token'))) { $val = new Validation(); $val->check($_POST, array('name' => array('required' => true), 'username' => array('required' => true, 'min' => 2, 'max' => 50, 'unique' => users), 'password' => array('required' => true, 'min' => 8), 'password_conf' => array('required' => true, 'matches' => 'password'))); if (!$val->passed()) { foreach ($val->errors() as $error) { echo $error . '<br/>'; } } else { $salt = hash::salt(32); $password = hash::make(escape(Input::get('password')), $salt); try { $user->create(array('username' => escape(Input::get('username')), 'password' => Hash::make(escape(Input::get('password')), $salt), 'salt' => $salt, 'name' => escape(Input::get('name')), 'joined' => date('Y-m-d- H:i:s'), 'group' => 1)); } catch (Exception $e) { die($e->getMessage()); } session::flash('complete', 'you completely register'); Redirect::to(path . 'index.php'); } } } ?> <html> <head> <?php include path . 'assets/php/css.php'; ?> </head> <body> <?php include path . 'assets/php/nav.php'; ?>