Ejemplo n.º 1
0
 function show()
 {
     $this->login = new Login($this->system);
     $this->system->login_template = INSTALL_PATH . '/Module/PageLogin/Login.template.html';
     if (Login::check_login()) {
         return $this->logged_in_message();
     } else {
         return $this->login->show();
     }
 }
 function content_module($title, $module)
 {
     $vars['title'] = $title;
     $vars['navi'] = $this->navi_menu();
     if (preg_match('/(.*?)\\((.*?)\\)/', $module, $match)) {
         $module = $match[1];
         $args = $match[2];
     }
     if (!class_exists($module)) {
         include_once $module . '.php';
     }
     if (is_callable(array($module, 'class_init'))) {
         eval('$instance = new $module (' . $args . ');');
         $instance->class_init($this);
     } else {
         $instance = new $module($this);
     }
     if ($module != 'Login' && $this->require_valid_user) {
         // hier nochmal checken, falls Modul eine eigene User-Tabelle mitbringt
         if ($this->custom_user_table) {
             Login::check_login($this);
         }
         if (!$this->valid_user) {
             return;
         }
     }
     $instance_show = $instance->show();
     $vars['other_css'] = $this->other_css;
     if (isset($instance->other_css)) {
         $vars['other_css'] .= $instance->other_css;
     }
     if (isset($GLOBALS['other_css'])) {
         $vars['other_css'] .= $GLOBALS['other_css'];
     }
     $vars['scripts'] = $this->scripts;
     if (isset($instance->scripts)) {
         $vars['scripts'] .= $instance->scripts;
     }
     //deprecated
     if (isset($GLOBALS['scripts'])) {
         $vars['scripts'] .= $GLOBALS['scripts'];
     }
     // half deprecated
     if (isset($_GET['noframe']) || $this->noframe) {
         if (isset($instance->extern)) {
             $GLOBALS['INCLUDE_EXTERN'] = $instance->extern;
             return;
         }
         return $instance_show;
     }
     if (RheinaufFile::is_file(DOCUMENT_ROOT . INSTALL_PATH . '/Templates/' . $modul . '/template.html')) {
         $page = new Seite($this, DOCUMENT_ROOT . INSTALL_PATH . '/Templates/' . $modul . '/template.html');
     } else {
         $page = new Seite($this, $this->template ? $this->template : 'default');
     }
     if (isset($instance->extern)) {
         $GLOBALS['HEADER'] = $page->header($vars);
         $GLOBALS['FOOTER'] = $page->footer($vars);
         $GLOBALS['INCLUDE_EXTERN'] = $instance->extern;
         return;
     }
     $header = $page->header($vars);
     //	if ($modul!='Admin')
     //	{
     $content = new Template($instance_show);
     $content->system =& $this;
     $content->init_snippets();
     $content = $content->parse_template('', $vars);
     //	}
     //	else $content = $instance_show;
     $footer = $page->footer($vars);
     return $header . $content . $footer;
 }
Ejemplo n.º 3
0
    function show()
    {
        if (!Login::check_login($this->system)) {
            $page = new Seite($this->system, $this->login_tpl);
            $login = new Login($this->system);
            return $page->header() . $login->show() . $page->footer();
        }
        preg_match("/Admin\\/([^\\/|?|#]*)/", $_SERVER['REQUEST_URI'], $m);
        $this->modul = $m[1];
        $installed_modules = $this->connection->db_assoc("SELECT * FROM `RheinaufCMS>Module` WHERE `Backend` != '' ORDER BY `id` ASC");
        for ($i = 0; $i < count($installed_modules); $i++) {
            $this->installed_modules[$installed_modules[$i]['sysID']] = $installed_modules[$i];
        }
        if (!$_SESSION['RheinaufCMS_User']['allowed_actions']) {
            unset($_SESSION['RheinaufCMS_User']);
            $page = new Seite($this->system, $this->login_tpl);
            $login = new Login($this->system);
            return $page->header() . $login->show('Entschuldigung, Sie haben nicht die Erforderlichen Rechte.') . $page->footer();
        }
        if ($_SESSION['RheinaufCMS_User']['Group'] == 'dev') {
            for ($i = 0; $i < count($installed_modules); $i++) {
                $allowed_modules[] = $installed_modules[$i]['sysID'];
            }
            $_SESSION['RheinaufCMS_User']['allowed_modules'] = $this->allowed_modules = $allowed_modules;
        } else {
            $allowed_modules_sql = "SELECT  * FROM `RheinaufCMS>Rechte` WHERE `id` = '" . implode("' OR `id` ='", $_SESSION['RheinaufCMS_User']['allowed_actions']) . "' ";
            $allowed_modules = $this->connection->db_assoc($allowed_modules_sql);
            $this->allowed_modules = array();
            for ($i = 0; $i < count($allowed_modules); $i++) {
                $this->allowed_modules[] = $allowed_modules[$i]['ModulName'];
            }
            $this->allowed_modules = array_unique($this->allowed_modules);
            if (count($this->allowed_modules) == 0) {
                $this->login('', $this->login_tpl);
            }
            $_SESSION['RheinaufCMS_User']['allowed_modules'] = $this->allowed_modules;
        }
        if ($this->modul != '') {
            $return = '';
            //print_r($this->installed_modules);
            $class = $this->modul;
            include INSTALL_PATH . '/' . $this->installed_modules[$class]['Backend'];
            if (!class_exists($class)) {
                $return = 'Modul nicht installiert';
            } else {
                $instance = new $class($this->system);
                $return .= $instance->show();
            }
            $this->scripts = isset($instance->scripts) ? $instance->scripts : '';
        }
        if ($this->system->backend->tabs) {
            $return = Html::div(Html::span($this->system->backend->tabs), array('id' => 'admin_tabs')) . $return;
        }
        if ($this->system->noframe || isset($_GET['noframe'])) {
            return $return;
        }
        $this->system->noframe = true;
        $page = new Html(PROJECT_NAME . ' - Verwaltungsbereich');
        $page->stylesheet('/CSS/Admin.css');
        $page->custom('
		<!-- compliance patch for microsoft browsers -->
<!--[if lt IE 7]>
<script src="/Libraries/IE7/ie7-standard-p.js" type="text/javascript">
</script>
<![endif]-->
		');
        if ($GLOBALS['other_css']) {
            $page->header_string .= $GLOBALS['other_css'];
        }
        if ($GLOBALS['scripts']) {
            $page->header_string .= $GLOBALS['scripts'];
        }
        if (!$GLOBALS['http_request_scripts']) {
            $page->header_string .= Html::script('', array('src' => '/Scripts/XMLHttpRequest.js'));
            $GLOBALS['http_request_scripts'] = true;
        }
        $page->header_string .= Html::script('     	function pinghome ()
	     	{
	     		var url = location.protocol + "/"+"/"+ location.host +"/Admin?ping";
	     		httpRequestGET (url,function(){
	     		setTimeout(pinghome,120000);
	     		}, false)
	     	}
	     	setTimeout(pinghome,120000);');
        if (isset($_GET['nomenu'])) {
            $page->div($return, array('id' => 'content'));
            return $page->flush_page();
        } else {
            $user = $this->system->user['Name'];
            $logout = Html::span("Guten Tag, " . $user . ' ' . Html::a('?logout=' . rawurlencode($user), ' logout'), array('id' => 'logout'));
            $page->div(Html::span($this->system->backend->top) . $logout, array('id' => 'admin_top'));
            $page->div('', array('id' => 'lo_logo'));
            $page->div('', array('id' => 'menu_appendix'));
            $page->custom($this->admin_menu());
            $page->div(Html::div($this->installed_modules[$class]['Name'], array('id' => 'module_name')) . $return . '<br style="clear:both />', array('id' => 'content', 'class' => 'admin content'));
            return $page->flush_page();
        }
    }
Ejemplo n.º 4
0
<?php

require 'classes/login.php';
$db = new DB();
$db->connect();
$username = mysqli_real_escape_string($db->con, $_POST['username']);
$password = mysqli_real_escape_string($db->con, $_POST['password']);
$login = new Login($username, $password);
$check = $login->check_login();
if ($check == 1) {
    $send = array("status" => "111");
    //successful login
    echo json_encode($send);
} else {
    $send = array("status" => "000");
    //invalid login
    echo json_encode($send);
}
Ejemplo n.º 5
0
 function http_login(&$system, $realm = '')
 {
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!$realm) {
         $realm = PROJECT_NAME;
     }
     if (!isset($_SESSION['RheinaufCMS_User'])) {
         if (!isset($_SERVER['PHP_AUTH_USER'])) {
             Header("WWW-Authenticate: Basic realm=\"{$realm}\"");
             Header("HTTP/1.0 401 Unauthorized");
             return false;
             exit;
         } else {
             $_POST['user'] = $_SERVER['PHP_AUTH_USER'];
             $_POST['pass'] = $_SERVER['PHP_AUTH_PW'];
             return Login::check_login($system);
         }
     }
 }
<?php

session_start();
include '../classes/class.login.php';
$username = $_POST['username'];
$password = $_POST['password'];
$log = new Login();
$log->username = $username;
$log->password = $password;
$count = $log->check_login();
if ($count != 0) {
    header('location:../BackEnd/index.php');
} else {
    header('location:../index.php?error=1');
}
Ejemplo n.º 7
0
<?php

session_start();
if (isset($_SESSION['sess_user_admin_login_id']) != NULL) {
    header('Location:deshbord.php');
}
require_once './classes/login.php';
$obj_login = new Login();
if (isset($_POST['btn'])) {
    $obj_login->check_login($_POST);
}
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Login :: Hospital Management System</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.4 -->
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="assets/dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    <!-- iCheck -->
    <link href="assets/plugins/iCheck/square/blue.css" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>