Exemplo n.º 1
0
if (!$p) {
    redirect_to("index.php");
}
if (isset($_POST['submit'])) {
    if (CSRF::check($_POST['token'])) {
        $author = htmlspecialchars($_POST['author']);
        $body = htmlspecialchars($_POST['body']);
        $comment = Comment::make($p->id, $author, $body);
        if ($comment) {
            $comment->create();
            $msg = opmsg("Comment posted successfully and awaiting moderation!", "success");
        } else {
            $msg = opmsg("Failed", "danger");
        }
    } else {
        $msg = opmsg("Failed", "danger");
    }
} else {
    $author = "";
    $body = "";
    $msg = "";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
Exemplo n.º 2
0
$a = new Auth();
if (Auth::isLoggedIn()) {
    redirect_to('index.php');
    exit;
}
if (isset($_POST['submit'])) {
    $username = $_POST['username'];
    $password = $_POST['password'];
    $u = User::auth($username, $password);
    if ($u) {
        $a->login($u);
        $_SESSION['ACTIVITY'] = time();
        Logger::start()->add($username, $_SERVER['PHP_SELF'], 'Login');
        redirect_to('index.php');
    } else {
        $msg = opmsg("Username or Password Incorrect", "danger");
    }
} else {
    $username = "";
    $password = "";
    $msg = "";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
	<!--<link rel="icon" href="../../favicon.ico"> -->
Exemplo n.º 3
0
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
$u = User::getUser();
$users = User::getAllUsers();
//$l = Logger::start();
$msg = "";
if (isset($_POST['del'])) {
    $id = intval($_POST['did']);
    $d = User::delete($id);
    if ($d) {
        $msg = opmsg("User Deleted Successfully", "success");
        redirect_to('manageusers.php');
    } else {
        $msg = opmsg("User Not Deleted", "danger");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
Exemplo n.º 4
0
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
$u = User::getUser();
$msg = "";
if (isset($_POST['addPicture'])) {
    $p = new Pics();
    $p->caption = $_POST['caption'];
    $p->slug = slugify($_POST['caption']);
    $upload = $p->start($_FILES['picture']);
    if ($upload) {
        Logger::start()->add($u->username, $_SERVER['PHP_SELF'], 'File Upload');
        $msg = opmsg("Picture uploaded successfully", "success");
    } else {
        $msg = opmsg($p->errors[0], "failed");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
Exemplo n.º 5
0
    if ($d) {
        $msg = opmsg("Comment Deleted Successfully", "success");
        redirect_to('managecomments.php');
    } else {
        $msg = opmsg("Comment Not Deleted", "danger");
    }
}
if (isset($_POST['approve'])) {
    $id = intval($_POST['cid']);
    $data['allowed'] = 1;
    $d = Comment::update($id, $data);
    if ($d) {
        $msg = opmsg("Comment Approved Successfully", "success");
        redirect_to('managecomments.php');
    } else {
        $msg = opmsg("Comment Not Approved", "danger");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
Exemplo n.º 6
0
}
$u = User::getUser();
//$l = Logger::start();
$msg = "";
if (isset($_POST['add'])) {
    $field = User::checkUsername(array('username' => $_POST['username']));
    if (!$field) {
        $data = array('username' => $_POST['username'], 'password' => password_hash($_POST['password'], PASSWORD_BCRYPT), 'fname' => $_POST['fname'], 'lname' => $_POST['lname']);
        $create = User::create($data);
        if ($create) {
            $msg = opmsg("User Added Successfully", "success");
        } else {
            $msg = opmsg("User Not Added", "danger");
        }
    } else {
        $msg = opmsg("Username Exists", "danger");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
Exemplo n.º 7
0
        $caption = $pic->caption;
        $file = "../images/" . $pic->filename;
    } else {
        redirect_to('manageusers.php');
        exit;
    }
}
if (isset($_POST['update'])) {
    $id = $_POST['id'];
    $data = array('username' => $_POST['username'], 'password' => password_hash($_POST['password'], PASSWORD_BCRYPT), 'fname' => $_POST['fname'], 'lname' => $_POST['lname']);
    $update = User::update($id, $data);
    if ($update) {
        $msg = opmsg("User Updated Successfully", "success");
        redirect_to('manageusers.php');
    } else {
        $msg = opmsg("User Updation Failed", "danger");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">    
Exemplo n.º 8
0
if (!$a->isLoggedIn()) {
    redirect_to('login.php');
    exit;
}
$u = User::getUser();
$pics = Pics::getAllPics();
//$l = Logger::start();
$msg = "";
if (isset($_POST['del'])) {
    $id = intval($_POST['did']);
    $d = Pics::delete($id);
    if ($d) {
        $msg = opmsg("Pic Deleted Successfully", "success");
        redirect_to('managepics.php');
    } else {
        $msg = opmsg("Pic Not Deleted", "danger");
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!--<link rel="icon" href="../../favicon.ico"> -->
<title>Photolia</title>

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">