コード例 #1
0
ファイル: scripts.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // Check if file to display is set
     if (isset($_GET['show'])) {
         $this->filename = $_GET['show'];
     }
     // Check if file is to be deleted
     if (isset($_GET['delfile'])) {
         $this->delete();
     }
     // Get the path to the target file
     if ($this->filename != "../main.js") {
         $this->filename = "../site-assets/js/" . $this->filename;
     } else {
         $this->homeclass = 'label label-info';
         $this->deletebtn = '<a href="scripts.php?delfile=' . $this->filename . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>';
     }
     // Check if layout file is present
     if (!file_exists($this->filename)) {
         header('HTTP/1.1 400 BAD REQUEST');
         die('Javascript not Found !<br><a href="scripts.php"> click here for scripts</a>');
     }
     // get the contents of the controller file (index.php)
     $this->content = htmlspecialchars(file_get_contents($this->filename));
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
     //Build the HTML Treeview
     $this->buildTree();
     // Get the Message to display if any
     $this->getMessage();
 }
コード例 #2
0
ファイル: layouts.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // Check if file to display is set
     if (isset($_GET['show'])) {
         $this->filename = 'layout.' . $_GET['show'];
     }
     // Check if file is to be deleted
     if (isset($_GET['delfile'])) {
         $this->delete();
     }
     // Check if layout file is present
     if (!file_exists('../' . $this->filename)) {
         header('HTTP/1.1 400 BAD REQUEST');
         die('Layout not Found !<br><a href="layouts.php"> click here for layouts</a>');
     }
     // get the contents of the layout file
     $this->content = htmlspecialchars(file_get_contents('../' . $this->filename));
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
     // Set selected class on home node if defaults file
     if ($this->filename == "layout.php") {
         $this->homeclass = 'label label-info';
     } else {
         $this->deletebtn = '<a href="layouts.php?delfile=' . $this->filename . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>';
     }
     //Build the HTML Treeview
     $this->buildTree();
     // Get the Message to display if any
     $this->getMessage();
 }
コード例 #3
0
ファイル: profile.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
 }
コード例 #4
0
ファイル: settings.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
     // Get the Message to display if any
     $this->getMessage();
 }
コード例 #5
0
ファイル: controller.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // get the contents of the controller file (index.php)
     $this->content = htmlspecialchars(file_get_contents("../index.php"));
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
     // Get the Message to display if any
     $this->getMessage();
 }
コード例 #6
0
ファイル: users.class.php プロジェクト: moahmed/ezcms
    public function __construct()
    {
        // call parent constuctor
        parent::__construct();
        // Update the user if Posted
        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
            $this->update();
        }
        // Check if delete ID is set
        if (isset($_GET['delid'])) {
            $this->delete();
        }
        // Check if user to display is set
        if (isset($_GET['id'])) {
            $this->id = $_GET['id'];
        }
        if ($this->id != 'new') {
            $this->thisUser = $this->query('SELECT * FROM `users` WHERE `id` = ' . $this->id . ' LIMIT 1')->fetch(PDO::FETCH_ASSOC);
            // get the selected user details
            $this->setOptions('active', 'User is Active.', 'Inactive user cannot login.');
            $this->setOptions('editpage', 'Page management available.', 'Page management blocked.');
            $this->setOptions('delpage', 'Page delete available.', 'Page delete blocked.');
            $this->setOptions('edituser', 'User can manage other users.', 'User cannot manage other users.');
            $this->setOptions('deluser', 'User can delete other users.', 'User cannot delete other users.');
            $this->setOptions('editsettings', 'Template Settings management available.', 'Template Settings management blocked.');
            $this->setOptions('editcont', 'Template Controller management available.', 'Template Controller management blocked.');
            $this->setOptions('editlayout', 'Template Layout management available.', 'Template Layout management blocked.');
            $this->setOptions('editcss', 'Stylesheet management available.', 'Stylesheet management blocked.');
            $this->setOptions('editjs', 'Javascript management available.', 'Javascript management blocked.');
            $this->barBtns = '<input type="submit" name="Submit" class="btn btn-inverse" value="Save Changes">
				 <a href="?id=new" class="btn btn-inverse">New User</a>';
            if ($this->id != 1) {
                $this->barBtns .= ' <a href="scripts/del-user.php?delid=' . $this->id . '" onclick="return confirm(\'Confirm Delete ?\');" class="btn btn-danger">Delete</a>';
            }
        } else {
            $this->barBtns = '<input type="submit" name="Submit" class="btn btn-inverse" value="Add New">';
        }
        //Build the HTML Treeview
        $this->buildTree();
        // Get the Message to display if any
        $this->getMessage();
    }
コード例 #7
0
ファイル: pages.class.php プロジェクト: moahmed/ezcms
 public function __construct()
 {
     // call parent constuctor
     parent::__construct();
     // Update the Controller of Posted
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->update();
     }
     // Check if file to display is set
     if (isset($_GET['id'])) {
         $this->id = $_GET['id'];
     }
     if ($this->id != 'new') {
         $this->page = $this->query('SELECT * FROM `pages` WHERE `id` = ' . $this->id . ' LIMIT 1')->fetch(PDO::FETCH_ASSOC);
         // get the selected user details
         $this->setOptions('published', 'Page is published and visible to all.', 'Unpublished page only visible when logged in.');
     }
     //Build the HTML Treeview
     $this->buildTree();
     // Get the Message to display if any
     $this->getMessage();
 }
コード例 #8
0
ファイル: index.php プロジェクト: moahmed/ezcms
<?php

/*
 * ezCMS Code written by mo.ahmed@hmi-tech.net & mosh.ahmed@gmail.com
 *
 * Version 4.160210
 * HMI Technologies Mumbai
 *
 * View: Login page to ezCMS (index.php)
 * 
 */
// **************** ezCMS CLASS ****************
require_once "class/ezcms.class.php";
// CMS Class for database access
$cms = new ezCMS(false);
// create new instance of CMS Class with loginRequired = false
// Redirect the user if already logged in
if ($_SESSION['LOGGEDIN'] == true) {
    header("Location: pages.php");
    exit;
}
// Check if userid is set in the request
$userid = "";
// Reset Login
if (isset($_GET["userid"])) {
    $userid = $_GET["userid"];
}
// If userid is not set check session for it.
if ($userid == '' && isset($_SESSION['userid'])) {
    $userid = $_SESSION['userid'];
}