Esempio n. 1
0
 public static function getAll()
 {
     if (!user::isLoggedIn()) {
         return;
     }
     $id = User::getUserID();
     self::loadUserConfig($id);
     foreach (self::$userConfig as $key => $value) {
         self::$userConfig[$key] = json_decode($value, true);
     }
     return self::$userConfig;
 }
Esempio n. 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;
?>
Esempio n. 3
0
<?php

require '../includes/config.php';
require '../structure/database.php';
require '../structure/forum.php';
require '../structure/forum.thread.php';
require '../structure/base.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$thread_obj = new thread($database);
$user->updateLastActive();
//make sure required data is in the correct format AND they're logged in
if (!$user->isLoggedIn() || !ctype_digit($_REQUEST['forum']) || !ctype_digit($_REQUEST['id']) || !ctype_digit($_REQUEST['type']) || !ctype_digit($_REQUEST['pid']) && $_REQUEST['type'] == 1) {
    $base->redirect('index.php');
}
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_REQUEST['forum'];
$thread = $_REQUEST['id'];
//instead of typing it a million times, we're going to set our redirect url
$redirect = 'viewthread.php?forum=' . $f . '&id=' . $thread;
//make sure they are posting in a forum where they have permission
if ($user->checkMute($username) || !$thread_obj->canView($thread, $username, $rank) || !$thread_obj->canReply($thread, $rank)) {
    $base->redirect($redirect);
}
//extract content for the set type
$data = $_REQUEST['type'] == 1 ? $database->processQuery("SELECT `content`,`username`,`status` FROM `posts` WHERE `id` = ?", array($_REQUEST['pid']), true) : $database->processQuery("SELECT `username`,`content`,`status`,`title` FROM `threads` WHERE `id` = ?", array($thread), true);
Esempio n. 4
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> 
          
            
Esempio n. 5
0
* html .floatLeft {
	float: left;
	margin: 0 -3px;
	ma\rgin: 0; /* ie5 3px margin hack */
}
</style>
</head>
	<div id="body">
	
	<body style="background-image: url('../img/backgrounds/bg-1.jpg');">
		
<div class="frame e">
			<span style="float: right;">
			<?php 
if ($user->isLoggedIn()) {
    echo '<a href="../index.php">Main Page</a> | <a href="../logout.php">Logout</a>';
} else {
    echo '<a href="../index.php">Main Page</a> | <a href="../login.php">Login</a>';
}
?>
			</span>
			<div>
			<?php 
if ($user->isLoggedIn()) {
    echo 'You are logged in as <span style="color: rgb(255, 187, 34);">' . $username . '</span>';
} else {
    echo 'You are not logged in.';
}
?>
			</div>
									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $next;
?>
">next &gt;</a></li>
									<li><a href="viewforum.php?forum=<?php 
echo $f . '&page=' . $pages;
?>
">last &gt;&gt;</a></li>
								</ul>
							</form>
						</td>
						<td class="commands">
							<ul class="flat">
								<li><a href=""><img src="../img/forum/refresh.gif" alt=""> Refresh</a></li>
								<?php 
if ($user->isLoggedIn() && $forum->canCreate($f, $rank) && !$user->checkMute($username)) {
    echo '<li><a href="create.php?forum=' . $f . '"><img src="../img/forum/new_thread.gif" alt=""> Create a New Thread</a></li>';
}
?>
															</ul>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
			<div id="content" class="border">
				<table id="t_holder">
					<tr height="20px">
						<td width="63%"></td>
						<td width="15%" class="title num">Posts</td>
						<td width="22%" class="title">Last Post</td>
Esempio n. 7
0
<img src="img/title2/rslogo3.gif" alt="RuneScape"><br>
<?php 
$database->processQuery("SELECT * FROM `users`", array(), false);
echo 'There are currently ' . number_format($database->getRowCount()) . ' people registered!';
?>
</div>
</div>
<div class="left">
<fieldset class="menu rs">
<legend><?php 
echo $data['wb_abbr'];
?>
</legend>
<ul>
<?php 
if ($user->isLoggedIn()) {
    ?>
            <li class="i-create"><a href="logout.php">Logout</a></li>
            <li class="i-shop"><a href="donate.php">Donate</a></li>
        <?php 
} else {
    ?>
            <li class="i-create"><a href="create/index.php">Create a free account (New user)</a></li>
            <li class="i-play"><a href="login.php">Login with an existing account...</a></li>
        <?php 
}
?>
<li class="i-screen"><a href="screenshots.php">View daily Screenshot</a></li>
<li class="i-twitter"><a href="#">Twitter</a></li>
<li class="i-youtube"><a href="#">YouTube Channel</a></li>
Esempio n. 8
0
 public function options()
 {
     if ($this->exists()) {
         $userId = $this->data()->id;
         if ($result = DB::getInstance()->QueryGet("SELECT * FROM user_options WHERE userid = {$userId}")) {
             return $result->first();
         }
     } else {
         $user = new user();
         if ($user->isLoggedIn()) {
             $userId = $user->data()->id;
             if ($result = DB::getInstance()->QueryGet("SELECT * FROM user_options WHERE userid = {$userId}")) {
                 return $result->first();
             }
         }
     }
     return null;
 }
Esempio n. 9
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>';
            }
        }
    }
Esempio n. 10
0
<?php

require '../structure/base.php';
require '../includes/config.php';
require '../structure/database.php';
require '../structure/forum.php';
require '../structure/forum.thread.php';
require '../structure/user.php';
$database = new database($db_host, $db_name, $db_user, $db_password);
$base = new base($database);
$user = new user($database);
$forum = new forum($database);
$thread_obj = new thread($database);
//make sure the user is logged in and the required data is set
if (!$user->isLoggedIn() || !ctype_digit($_REQUEST['forum']) || !ctype_digit($_REQUEST['id'])) {
    $base->redirect('index.php');
}
//set some variables that are used a lot throughout the page
$username = $user->getUsername($_COOKIE['user'], 2);
$rank = $user->getRank($username);
$f = $_REQUEST['forum'];
$thread = $_REQUEST['id'];
//make sure they are posting in a forum where they have permission
if ($user->checkMute($username) || !$thread_obj->canView($thread, $username, $rank) || !$thread_obj->canReply($thread, $rank)) {
    $base->redirect('index.php');
}
//floodlimit time
$flood_limit = $database->processQuery("SELECT `floodlimit` FROM `config` LIMIT 1", array(), true);
//get the user's last post (time)
$last_post = $database->processQuery("SELECT `lastpost` FROM `users` WHERE `username` = ? LIMIT 1", array($username), true);
if (isset($_POST['message'])) {
Esempio n. 11
0
<?php

session_start();
include_once "user.inc.php";
?>
<html>
<head>
<title>checking password...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php 
if (!isset($_POST['username']) || !isset($_POST['password'])) {
    header("Refresh:0; URL=login.php");
}
$localuser = new user($_POST['username'], $_POST['password']);
if ($localuser->isLoggedIn()) {
    $_SESSION['user'] = serialize($localuser);
    session_write_close();
    header("Refresh:0;URL=userProfile.php");
} else {
    session_write_close();
    header("Refresh:3;URL=login.php");
    echo "There is a problem with your Username ({$_POST['username']}) or Password ({$_POST['password']}). You are being redirected\r\n\t\t to the login page. <br />\r\n\t\t If your browser does not support this or you are not redirected in 3 seconds,\r\n\t\t <a href = \"login.php\">click here</a>";
}
?>
</body>
</html>
Esempio n. 12
0
<?php

require_once 'core/init.php';
$handle = '';
$rs = array();
$user2 = new user();
$res = DB::getInstance();
if (!$user2->isLoggedIn() && $user2->data()->user_type == '3') {
    Redirect::to('index.php');
}
include 'includes/header.php';
echo "<div class='box3'>\n\t\t<div class='container'>";
if (input::get('q') && input::get('reservation') && input::get('product')) {
    $product_id = input::get('product');
    $reservation_id = input::get('reservation');
    $quantity = input::get('q');
    $requa = '';
    $name = '';
    $mess = 'done';
    $res->get('product', array('id', '=', $product_id));
    if ($res->count()) {
        foreach ($res->results() as $row) {
            $requa = $row->quantity;
            $name = $row->name;
        }
        $requa = $requa - $quantity;
        // $mess='loop product';
    }
    if ($requa >= 10) {
        $res->update('product', $product_id, array('quantity' => $requa));
    } else {