Esempio n. 1
0
<?php

$actionid = "services";
include "head.php";
include "functionapi.php";
if ($_POST['username'] != null && $_POST['password'] != null) {
    $user_class = array();
    $_SESSION['username'] = $_POST['username'];
    $user_class = isuser($_POST['username'], $_POST['password']);
    if ($user_class[0] == "admin") {
        $_SESSION['user_class'] = "admin";
        $_SESSION['user_id'] = $user_class[1];
    } else {
        $_SESSION['user_class'] = "user";
        $_SESSION['user_id'] = $user_class[1];
    }
} else {
    if ($_SESSION['user_class'] == null) {
        die("place relogin<a href ='login.php'>login page</a>");
    }
}
?>
 <div id="content">
                <div id="colOne">
			<h2>Nginx Services manager</h2>
			<?php 
$res = $dbconnect->query("select * from services");
is_error($res);
$servicesum = $res->numRows();
$res = $dbconnect->query("select DISTINCT serverip from services");
is_error($res);
Esempio n. 2
0
<?php

require_once 'config.php';
require_once SITE_DIR . '/lib/functions.php';
mysql_connect("localhost", "root", "root");
mysql_select_db("naranai");
if (!defined('USER_LEVEL')) {
    if (isuser($_COOKIE['user_id'])) {
        if (isowner($_COOKIE['user_id'])) {
            define('USER_LEVEL', '11');
        } elseif (isadmin($_COOKIE['user_id'])) {
            define('USER_LEVEL', '10');
        } else {
            define('USER_LEVEL', '1');
        }
    } else {
        define('USER_LEVEL', '0');
    }
}
if (!defined('IMAGE_EDIT')) {
    define('IMAGE_EDIT', get_option('permissions_image_edit'));
}
if (!defined('UPLOAD')) {
    define('UPLOAD', get_option('permissions_upload'));
}
if (!defined('TAG_EDIT')) {
    define('TAG_EDIT', get_option('permissions_tag_edit'));
}
if (!defined('GROUP_EDIT')) {
    define('GROUP_EDIT', get_option('permissions_group_edit'));
}
$eyes = $_POST['eyes'];
$hair = $_POST['hair'];
$skin = $_POST['skin'];
$height = $_POST['height'];
$build = $_POST['build'];

if ($username == "") die("<h4>You did not enter a username. Please click Back on your browser and do so.</h4>
				<br/>
			<center><img src=\"resources/images/illustrations/hobbit.png\" style=\"padding-top: 50px;\"/></center>");

$username = strtolower($username);
$username = ucwords($username);

for ($i = 0; $i < strlen($username); $i++) if (!(ord($username[$i]) >= 97 && ord($username[$i]) <= 122) && !(ord($username[$i]) >= 65 && ord($username[$i]) <= 90)) die("Your username may only contain letters. Please click Back on your browser and correct it.<BR>");

if (isuser($username)) die("<h4>That username is already in use. Please click Back on your browser and use a different one.</h4>
				<br/>
			<center><img src=\"resources/images/illustrations/hobbit.png\" style=\"padding-top: 50px;\"/></center>");

if (strlen($username) > 15) die("<h4>Your username may not be more than 15 characters long. Please click Back on your browser and correct it.</h4>
				<br/>
			<center><img src=\"resources/images/illustrations/hobbit.png\" style=\"padding-top: 50px;\"/></center>");

if (strlen($username) < 3) die("<h4>Your username may not be less than 3 characters long. Please click Back on your browser and correct it.</h4>
				<br/>
			<center><img src=\"resources/images/illustrations/hobbit.png\" style=\"padding-top: 50px;\"/></center>");

if ($pass1 !== $pass2) die("<h4>Your passwords did not match. Please click Back on your browser and correct it.</h4>
				<br/>
			<center><img src=\"resources/images/illustrations/hobbit.png\" style=\"padding-top: 50px;\"/></center>");