tuupola / frog_dashboard

Provides simple admin dashboard to Frog CMS.

This URL has Read+Write access

tuupola (author)
Thu Aug 13 00:33:13 -0700 2009
commit  4a3ed7470bbb2aba4f0a0e96516334eebaa21cf6
tree    6afb4849495532d6febb79bf9ed3b2fe89a2ed47
parent  575862c19e678cc77cfad9955fab7cd50faed5a6
frog_dashboard / enable.php
100644 47 lines (41 sloc) 1.184 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
 
/*
* Dashboard - Frog CMS dashboard plugin
*
* Copyright (c) 2008-2009 Mika Tuupola
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* http://www.appelsiini.net/
*
*/
 
/* Prevent direct access. */
if (!defined("FRAMEWORK_STARTING_MICROTIME")) {
    die("All your base are belong to us!");
}
 
$pdo = Record::getConnection();
$table = TABLE_PREFIX . "dashboard_log";
 
if (preg_match('/^mysql/', DB_DSN)) {
    /* Schema for MySQL */
    $pdo->exec("CREATE TABLE $table (
id INT(11) NOT NULL AUTO_INCREMENT,
ident CHAR(16) NOT NULL,
priority INT NOT NULL,
message VARCHAR(255),
username VARCHAR(64),
created_on DATETIME DEFAULT NULL,
PRIMARY KEY (id)
) DEFAULT CHARSET=utf8");
} else {
    /* Otherwise assume SQLite */
    $pdo->exec("CREATE TABLE $table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ident CHAR(16) NOT NULL,
priority INT NOT NULL,
message VARCHAR(255),
username VARCHAR(64),
created_on DATETIME DEFAULT NULL
)");
}