<link href="<?php echo branded_include('css/login.css'); ?> " rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="<?php echo branded_include('js/jquery-1.3.2.js'); ?> "></script> <script type="text/javascript" src="<?php echo branded_include('js/universal.js'); ?> "></script> </head> <body> <div id="notices"><?php echo get_notices(); ?> </div> <div id="login_form"> <h1>Control Panel</h1> <h2><?php echo $this->config->item('server_name'); ?> </h2> <form method="post" action="<?php echo site_url('dashboard/do_login'); ?> "> <ul> <li> <label for="username">Username</label>
function get_notices_xmlrpc($raw_params) { global $g, $xmlrpc_g; $params = xmlrpc_params_to_php($raw_params); if (!xmlrpc_auth($params)) { xmlrpc_authfail(); return $xmlrpc_g['return']['authfail']; } if (!function_exists("get_notices")) { require "notices.inc"; } if (!$params) { $toreturn = get_notices(); } else { $toreturn = get_notices($params); } $response = new XML_RPC_Response(XML_RPC_encode($toreturn)); return $response; }
<?php // Start the session. session_start(); // Moved functions to their own file so we can use them in page files. include 'includes/functions.php'; // Connect to the database. db_connect(); // If this is index.php, we won't get a path, so we need to set it. $path = isset($_GET['path']) ? $_GET['path'] : 'home.php'; // Render featured products. $featured_product_output = render_products(get_setting('featured_product_ids')); // Produce some variables to use in the template. $company_name = get_setting('company_name'); $year = date('Y'); // Show log in / log out links. $login_logout = '<a href="login.php">Log in</a>'; if (isset($_SESSION['user'])) { $login_logout = '<a href="' . url('login.php') . '">My account</a> | <a href="' . url('login.php') . '?action=logout">Log out</a>'; } // Include the file that matches the path name. include 'pages/' . $path; $notices = get_notices(); // Get admin.css if it's an admin page. $additional_css_files = ''; if (isset($_GET['path'])) { if (array_shift(explode('/', $_GET['path'])) == 'admin') { $additional_css_files .= '<link type="text/css" rel="stylesheet" media="all" href="' . url('styles/admin.css') . '" />'; } } include 'includes/page-template.php';
/** * Wrapper for get_notices() * * @param string $username * @param string $password * @param string $category * * @return bool */ public function get_notices($username, $password, $category = 'all') { $this->auth($username, $password); global $g; if (!function_exists("get_notices")) { require_once "notices.inc"; } if (!$params) { $toreturn = get_notices(); } else { $toreturn = get_notices($params); } return $toreturn; }
function site_notices($echo = true) { $output = ''; if (has_notices()) { $output .= '<div class="notices-box">'; $notices = get_notices(); foreach ($notices as $i => $n) { $output .= '<div class="' . (!isset($n['type']) ? 'updated' : $n['type']) . '">'; $output .= '<div class="container">'; $output .= '<p>' . $n['message'] . '</p>'; $output .= '</div>'; $output .= '</div>'; } unset($_SESSION['_notices']); $output .= '</div>'; } if (!$echo) { return $output; } echo $output; }