예제 #1
0
<?php 
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
    redirect::to('../index.php');
}
if (!$user->hasPermission("CompAdmin")) {
    redirect::to('../Includes/home.php');
}
?>


<html>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Orchestrate</title>
	<?php 
require_once 'headinfo.php';
?>
   
	<?php 
require_once 'slideMenu.php';
?>
 
	
	
		
예제 #2
0
<?php 
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
    redirect::to('../index.php');
}
if (!$user->hasPermission("Driver") && !$user->hasPermission("Rep")) {
    redirect::to('../Includes/home.php');
}
?>


<html>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Orchestrate</title>
	<?php 
require_once 'headinfo.php';
?>
   

</head> 
		
<body>
	<?php 
require_once 'slideMenu.php';
$myid = $user->data()->Id;
?>
예제 #3
0
<?php

require_once 'core/init.php';
$a = array(0);
$user = new user();
if (!$user->isLoggedIn() && !$user->hasPermission('admin')) {
    Redirect::to('login.php');
}
if ($user->hasPermission('admin') || $user->hasPermission('sadmin')) {
    include 'includes/ad_head.php';
    ?>
 
<div class="container-fluid">
      <div class="row">
        <div class="jumbotron">
 <center><p>For your Web Privacy You must<a href="logout.php"> Logout</a> Before close the Admin Panel </p></center>
  </div>

        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li><a href="pdfcontrol.php">Reports <span class="sr-only">(current)</span></a></li>
           <li> <a href="add.php"><b>Add</b></a></li>
          </ul>
          <ul class="nav nav-sidebar">
           <li> <a href="javascript:showOrHide('list');"><b>List</b></a></li>
            <li><a href="userProfile.php">profile</a></li>
            <li> <a href="search.php">Search user </a>
          </ul>
        </div> 
          
            
예제 #4
0
                        </li>
                        <li>
                            <a href="about.php">ABOUT</a>
                        </li>
                        <li>
                            <a href="contact.php">CONTACT</a>
                        </li>
                    <?php 
} else {
    if ($_SESSION['admin'] == true) {
        ?>
                            <li>
                                <a href="dashboard_admin.php">DASHBOARD</a>
                            </li>
                        <?php 
    } elseif ($user->hasPermission('coord')) {
        ?>
                            <li>
                                <a href="dashboard_coord.php">DASHBOARD</a>
                            </li>
                        <?php 
    } else {
        ?>
                            <li>
                                <a href="dashboard_student.php">DASHBOARD</a>
                            </li>
                        <?php 
    }
    ?>
                    <li>
                        <a href="about.php">ABOUT</a>
예제 #5
0
<?php

require_once '../Core/init.php';
$user = new user(null, $_log);
if (!$user->isLoggedIn()) {
    redirect::to('index.php');
}
if (!$user->hasPermission("Admin")) {
    redirect::to('index.php');
}
$files = scandir('../Log');
$_log->info('Trying to delete log');
for ($i = 2; $i < sizeof($files); $i++) {
    if ($i == sizeof($files) - 1) {
        if (file_put_contents("../Log/" . $files[$i], "") !== false) {
            $_log->info('Log file deleted by user: '******'Log file NOT deleted by user: '******'Log file NOT deleted by user: ' . $user->data()->Username);
            echo "File not deleted";
        }
    }
}
예제 #6
0
<p>Special query2 to see posts before a date</p>
<form name="form2" method="post" action="">
	<div>
		<input type="text" name="collect" placeholder="Date"> <input
			type="submit" name="send" value="Search">
	</div>
</form>
<?php 
        if (input::exists()) {
            $val = input::get('collect');
            if ($user->SpecialQuery2($user->data()->UserID, $val)) {
                echo '<br>' . 'posts are:' . '<br>';
                foreach ($user->lists() as $list) {
                    echo $list->Text . ' posted on ' . $list->RecievedBy;
                }
                //session::flash ( 'home', 'Posts are:' );
                //redirect::to ( 'index.php' );
            }
        }
        ?>

<?php 
    }
    // $Lname=input::get('LastName');
    // echo $Fname." ".$Lname ;
    if ($user->hasPermission('admin')) {
        echo 'You are an admin';
    }
} else {
    echo '<p>' . 'You need to <a href="login.php"> login</a> or <a href="register.php">register</a>' . '</p>';
}
예제 #7
0
<?php 
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
    redirect::to('../index.php');
}
if (!$user->hasPermission("Manager")) {
    redirect::to('../Includes/home.php');
}
?>


<html>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Orchestrate</title>
	<?php 
require_once 'headinfo.php';
?>
   
	<?php 
require_once 'slideMenu.php';
?>
 
	
	
		
예제 #8
0
<?php 
$user = new user(null, $_log);
$isrep = false;
$isdriver = false;
$ismanager = false;
$isadmin = false;
$isfinance = false;
if ($user->hasPermission("Rep")) {
    $isrep = true;
}
if ($user->hasPermission("Driver")) {
    $isdriver = true;
}
if ($user->hasPermission("Manager")) {
    $ismanager = true;
}
if ($user->hasPermission("Admin")) {
    $isadmin = true;
}
if ($user->hasPermission("Finance")) {
    $isfinance = true;
}
?>


<nav class="navbar navbar-default navbar-inverse" role="navigation">
	<div class="container-fluid">
	<div class="navbar-brand"><a href="../Includes/home.php">Orchestrate</a></div>

		<!-- <div class="navbar-brand"><a href="home.php">Booking</a></div> -->
예제 #9
0
<?php

require_once '../core/init.php';
req::once('functions/rand_pass.php');
$user = new user();
if ($user->hasPermission('logged in')) {
    redirect::to('index.php');
}
if (input::exists()) {
    $validate = new validate();
    $validate->check($_POST, array('email' => array('required' => true, 'min' => 2, 'max' => 32, 'unique' => 'users', 'email' => true), 'password' => array('required' => true, 'min' => 6, 'max' => 32), 'confirmation' => array('required' => true, 'matches' => 'password')));
    if ($validate->passed()) {
        $user = new user();
        $salt = hash::salt(32);
        $activation_code = random_code(16);
        $activation_hash = hash::make($activation_code);
        try {
            $id = $user->create(array('email' => input::get('email'), 'type' => input::get('account_type'), 'status' => 'u', 'password' => hash::make(input::get('password'), $salt), 'salt' => $salt, 'activation_code' => $activation_hash));
            mail(input::get('email'), 'Thank you for registering with MyBasket', 'To activate your account, go here: ' . config::get('site_url') . '/activate.php?code=' . $activation_code . '&user='******'email'));
            $db = db::getInstance();
            if (input::get('account_type') === 'l') {
                $db->insert('lab_user_data', array('user_id' => $id));
            } else {
                if (input::get('account_type') === 'd') {
                    $db->insert('ds_user_data', array('user_id' => $id));
                }
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
예제 #10
0
<?php 
require_once '../Core/init.php';
$user = new user(null, $_log);
$_db = db::getInstance();
if (!$user->isLoggedIn()) {
    redirect::to('../index.php');
}
if (!$user->hasPermission("Finance")) {
    redirect::to('../Includes/home.php');
}
?>


<html>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Orchestrate</title>
	<?php 
require_once 'headinfo.php';
?>
   

</head> 
		
<body>
	<?php 
require_once 'slideMenu.php';
$myid = $user->data()->Id;
?>
예제 #11
0
<?php

ob_start();
require_once '../Core/init.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>';
            }
        }
    }