Exemple #1
0
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
session_start();
define('BAYONET_INCLUDE', '../include');
define('BAYONET_CONFIG', '../include/config.php');
include BAYONET_INCLUDE . '/debug.php';
include BAYONET_INCLUDE . '/sql.class.php';
include BAYONET_INCLUDE . '/functions.php';
require_once BAYONET_INCLUDE . '/classes.php';
Bayonet_Config::init();
$config = Bayonet_Config::$ini;
$db = new Bayonet_SQL();
$db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']);
$db->Select_db($config['sql']['database']);
//$config['logs']['dir'] = "../logs/";
include 'header.php';
if (!defined("MODULE_FILE")) {
    //die("Access denied.");
}
define("ADMIN_FILE", 'admin_file');
include 'admin_functions.php';
if (isset($_GET['op']) && $_GET['op'] == 'logout') {
    logout();
}
if (login()) {
Exemple #2
0
 static function init()
 {
     global $db, $config;
     Bayonet_Config::init();
     // Set globally referenced configuration and database variables
     $config = Bayonet_Config::$ini;
     $db = new Bayonet_SQL();
     //Connect to the MySQL server
     $db->Connect($config['sql']['hostname'], $config['sql']['username'], $config['sql']['password']);
     $db->Select_db($config['sql']['database']);
     decho('Initializing Bayonet');
     Bayonet_Theme::init();
 }