*/\r
\r
/*\r
- This part of the install.php code allows for customization of the install process.\r
- When distributing plugins or skins together with a Nucleus installation, the\r
- configuration below will instruct to install them\r
+ This part of the install.php code allows for customization of the install process.\r
+ When distributing plugins or skins together with a Nucleus installation, the\r
+ configuration below will instruct to install them\r
\r
- -- Start Of Configurable Part --\r
+ -- Start Of Configurable Part --\r
*/\r
\r
include('./install_lang_japanese.php');\r
//\r
// example:\r
// array('NP_TrackBack', 'NP_MemberGoodies')\r
-$aConfPlugsToInstall = array('NP_SkinFiles', 'NP_SecurityEnforcer', 'NP_Text');\r
+$aConfPlugsToInstall = array(\r
+ 'NP_SkinFiles',\r
+ 'NP_SecurityEnforcer',\r
+ 'NP_Text'\r
+);\r
\r
\r
// array with skins to install. skins must be present under the skins/ directory with\r
//\r
// example:\r
// array('base','rsd')\r
-$aConfSkinsToImport = array('default');\r
+$aConfSkinsToImport = array(\r
+ 'atom',\r
+ 'default',\r
+ 'rsd',\r
+ 'rss2.0',\r
+);\r
\r
/*\r
- -- End Of Configurable Part --\r
+ -- End Of Configurable Part --\r
*/\r
\r
// don't give warnings for uninitialized vars\r
// if there are some plugins or skins to import, do not include vars\r
// in globalfunctions.php again... so set a flag\r
if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
- global $CONF;\r
- $CONF['installscript'] = 1;\r
+ global $CONF;\r
+ $CONF['installscript'] = 1;\r
}\r
\r
if (phpversion() >= '4.1.0') {\r
- include_once('nucleus/libs/vars4.1.0.php');\r
+ include_once('nucleus/libs/vars4.1.0.php');\r
} else {\r
- include_once('nucleus/libs/vars4.0.6.php');\r
+ include_once('nucleus/libs/vars4.0.6.php');\r
}\r
\r
// include core classes that are needed for login & plugin handling\r
//set the handler if different from mysql (or mysqli)\r
//$MYSQL_HANDLER = array('pdo','mysql');\r
if (!isset($MYSQL_HANDLER))\r
- $MYSQL_HANDLER = array('mysql','');\r
+ $MYSQL_HANDLER = array('mysql','');\r
include_once('nucleus/libs/sql/'.$MYSQL_HANDLER[0].'.php');\r
// end new for 3.5 sql_* wrapper\r
include_once('nucleus/libs/mysql.php');\r
\r
// check if mysql support is installed\r
// this check may not make sense, as is, in a version past 3.5x\r
- if (!function_exists('mysql_query') ) {\r
- _doError(_ERROR1);\r
- }\r
+ if (!function_exists('mysql_query') ) {\r
+ _doError(_ERROR1);\r
+ }\r
\r
- if (postVar('action') == 'go') {\r
- doInstall();\r
- } else {\r
- showInstallForm();\r
- }\r
+ if (postVar('action') == 'go') {\r
+ doInstall();\r
+ } else {\r
+ showInstallForm();\r
+ }\r
\r
exit;\r
\r
function showInstallForm() {\r
- // 0. pre check if all necessary files exist\r
- doCheckFiles();\r
-\r
- ?>\r
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
- <html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />\r
- <title><?php echo _TITLE; ?></title>\r
- <style type="text/css"><!--\r
- @import url('nucleus/documentation/styles/manual.css');\r
- --></style>\r
- <script type="text/javascript"><!--\r
- var submitcount = 0;\r
-\r
- // function to make sure the submit button only gets pressed once\r
- function checkSubmit() {\r
- if (submitcount == 0) {\r
- submitcount++;\r
- return true;\r
- } else {\r
- return false;\r
- }\r
- }\r
- --></script>\r
- </head>\r
- <body>\r
- <div style="text-align:center"><img src="./nucleus/styles/logo.gif" /></div> <!-- Nucleus logo -->\r
- <form method="post" action="install.php">\r
-\r
- <h1><?php echo _HEADER1; ?></h1>\r
-\r
- <?php echo _TEXT1; ?>\r
-\r
- <h1><?php echo _HEADER1_2 ?></h1>\r
-\r
- <?php echo _TEXT1_2; ?>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT1_2_TAB_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><?php echo _TEXT1_2_TAB_FIELD1; ?></td>\r
- <td>\r
- <select name="charset" tabindex="10000">\r
- <option value="utf8" selected="selected">UTF-8</option>\r
- <option value="ujis" >EUC-JP</option>\r
- </select>\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <h1><?php echo _HEADER2; ?></h1>\r
-\r
- <?php echo _TEXT2; ?>\r
-\r
- <ul>\r
- <li>PHP:\r
+ // 0. pre check if all necessary files exist\r
+ doCheckFiles();\r
+\r
+ ?>\r
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+ <html xmlns="http://www.w3.org/1999/xhtml">\r
+ <head>\r
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />\r
+ <title><?php echo _TITLE; ?></title>\r
+ <style type="text/css"><!--\r
+ @import url('nucleus/documentation/styles/manual.css');\r
+ --></style>\r
+ <script type="text/javascript"><!--\r
+ var submitcount = 0;\r
+\r
+ // function to make sure the submit button only gets pressed once\r
+ function checkSubmit() {\r
+ if (submitcount == 0) {\r
+ submitcount++;\r
+ return true;\r
+ } else {\r
+ return false;\r
+ }\r
+ }\r
+ --></script>\r
+ </head>\r
+ <body>\r
+ <div style="text-align:center"><img src="./nucleus/styles/logo.gif" /></div> <!-- Nucleus logo -->\r
+ <form method="post" action="install.php">\r
+\r
+ <h1><?php echo _HEADER1; ?></h1>\r
+\r
+ <?php echo _TEXT1; ?>\r
+\r
+ <h1><?php echo _HEADER1_2 ?></h1>\r
+\r
+ <?php echo _TEXT1_2; ?>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT1_2_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT1_2_TAB_FIELD1; ?></td>\r
+ <td>\r
+ <select name="charset" tabindex="10000">\r
+ <option value="utf8" selected="selected">UTF-8</option>\r
+ <option value="ujis" >EUC-JP</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <h1><?php echo _HEADER2; ?></h1>\r
+\r
+ <?php echo _TEXT2; ?>\r
+\r
+ <ul>\r
+ <li>PHP:\r
\r
<?php\r
- echo phpversion();\r
- $minVersion = '4.0.6';\r
-\r
- if (phpversion() < $minVersion) {\r
- echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN, $minVersion) . '</span>';\r
- } elseif (phpversion() < '5') {\r
- echo ' <span class="warning" style="display:block">' . _TEXT2_WARN3 . '</span>';\r
- }\r
+ echo phpversion();\r
+ $minVersion = '4.0.6';\r
+\r
+ if (phpversion() < $minVersion) {\r
+ echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN, $minVersion) . '</span>';\r
+ } elseif (phpversion() < '5') {\r
+ echo ' <span class="warning" style="display:block">' . _TEXT2_WARN3 . '</span>';\r
+ }\r
?>\r
\r
- </li>\r
- <li>MySQL:\r
+ </li>\r
+ <li>MySQL:\r
\r
<?php\r
- // note: this piece of code is taken from phpMyAdmin\r
- $conn = sql_connect_args('localhost','','');\r
- $result = @sql_query('SELECT VERSION() AS version', $conn);\r
-\r
- if ($result != FALSE && @sql_num_rows($result) > 0) {\r
- $row = sql_fetch_array($result);\r
- $match = explode('.', $row['version']);\r
- } else {\r
- $result = @sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
-\r
- if ($result != FALSE && @sql_num_rows($result) > 0) {\r
- $row = sql_fetch_row($result);\r
- $match = explode('.', $row[1]);\r
- } else {\r
- $output = shell_exec('mysql -V');\r
- $output = (function_exists('shell_exec')) ? @shell_exec('mysql -V') : '0.0.0';\r
- preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
- $match = explode('.', $version[0]);\r
-\r
- if ($match[0] == '') {\r
- $match[0] = '0';\r
- $match[1] = '0';\r
- $match[2] = '0';\r
- }\r
- }\r
- }\r
-\r
- sql_disconnect($conn);\r
- $mysqlVersion = implode($match, '.');\r
- $minVersion = '3.23';\r
-\r
- if ($mysqlVersion == '0.0.0') {\r
- echo _NOTIFICATION1;\r
- }\r
- else {\r
- echo $mysqlVersion;\r
- }\r
-\r
- if ($mysqlVersion < $minVersion) {\r
- echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN2, $minVersion) . '</span>';\r
- }\r
+ // note: this piece of code is taken from phpMyAdmin\r
+ $conn = sql_connect_args('localhost','','');\r
+ $result = @sql_query('SELECT VERSION() AS version', $conn);\r
+\r
+ if ($result != FALSE && @sql_num_rows($result) > 0) {\r
+ $row = sql_fetch_array($result);\r
+ $match = explode('.', $row['version']);\r
+ } else {\r
+ $result = @sql_query('SHOW VARIABLES LIKE \'version\'', $conn);\r
+\r
+ if ($result != FALSE && @sql_num_rows($result) > 0) {\r
+ $row = sql_fetch_row($result);\r
+ $match = explode('.', $row[1]);\r
+ } else {\r
+ $output = shell_exec('mysql -V');\r
+ $output = (function_exists('shell_exec')) ? @shell_exec('mysql -V') : '0.0.0';\r
+ preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);\r
+ $match = explode('.', $version[0]);\r
+\r
+ if ($match[0] == '') {\r
+ $match[0] = '0';\r
+ $match[1] = '0';\r
+ $match[2] = '0';\r
+ }\r
+ }\r
+ }\r
+\r
+ sql_disconnect($conn);\r
+ $mysqlVersion = implode($match, '.');\r
+ $minVersion = '3.23';\r
+\r
+ if ($mysqlVersion == '0.0.0') {\r
+ echo _NOTIFICATION1;\r
+ }\r
+ else {\r
+ echo $mysqlVersion;\r
+ }\r
+\r
+ if ($mysqlVersion < $minVersion) {\r
+ echo ' <span class="warning" style="display:block">' . sprintf(_TEXT2_WARN2, $minVersion) . '</span>';\r
+ }\r
?>\r
\r
- </li>\r
- </ul>\r
+ </li>\r
+ </ul>\r
\r
<?php\r
- // tell people how they can have their config file filled out automatically\r
- if (@file_exists('config.php') && @!is_writable('config.php')) {\r
+ // tell people how they can have their config file filled out automatically\r
+ if (@file_exists('config.php') && @!is_writable('config.php')) {\r
?>\r
\r
- <h1><?php echo _HEADER3; ?></h1>\r
+ <h1><?php echo _HEADER3; ?></h1>\r
\r
- <?php echo _TEXT3;\r
+ <?php echo _TEXT3;\r
\r
} ?>\r
\r
- <h1><?php echo _HEADER4; ?></h1>\r
-\r
- <?php echo _TEXT4; ?>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT4_TAB_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><?php echo _TEXT4_TAB_FIELD1; ?></td>\r
- <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" tabindex="10010" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT4_TAB_FIELD2; ?></td>\r
- <td><input name="mySQL_user" tabindex="10020" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT4_TAB_FIELD3; ?></td>\r
- <td><input name="mySQL_password" type="password" tabindex="10030" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT4_TAB_FIELD4; ?></td>\r
- <td><input name="mySQL_database" tabindex="10040" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" tabindex="10050" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT4_TAB2_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" tabindex="10060" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
- <td><input name="mySQL_tablePrefix" value="" tabindex="10070" /></td>\r
- </tr>\r
- </table>\r
-\r
- <?php echo _TEXT4_TAB2_ADD; ?>\r
-\r
- </fieldset>\r
-\r
- <h1><?php echo _HEADER5; ?></h1>\r
-\r
- <?php echo _TEXT5; ?>\r
+ <h1><?php echo _HEADER4; ?></h1>\r
+\r
+ <?php echo _TEXT4; ?>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT4_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT4_TAB_FIELD1; ?></td>\r
+ <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" tabindex="10010" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT4_TAB_FIELD2; ?></td>\r
+ <td><input name="mySQL_user" tabindex="10020" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT4_TAB_FIELD3; ?></td>\r
+ <td><input name="mySQL_password" type="password" tabindex="10030" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT4_TAB_FIELD4; ?></td>\r
+ <td><input name="mySQL_database" tabindex="10040" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" tabindex="10050" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT4_TAB2_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" tabindex="10060" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
+ <td><input name="mySQL_tablePrefix" value="" tabindex="10070" /></td>\r
+ </tr>\r
+ </table>\r
+\r
+ <?php echo _TEXT4_TAB2_ADD; ?>\r
+\r
+ </fieldset>\r
+\r
+ <h1><?php echo _HEADER5; ?></h1>\r
+\r
+ <?php echo _TEXT5; ?>\r
\r
<?php\r
\r
- // no need to this all! dirname(__FILE__) is all we need -- moraes\r
- /*\r
- // discover full path\r
- $fullPath = serverVar('PATH_TRANSLATED');\r
+ // no need to this all! dirname(__FILE__) is all we need -- moraes\r
+ /*\r
+ // discover full path\r
+ $fullPath = serverVar('PATH_TRANSLATED');\r
\r
- if ($fullPath == '') {\r
- $fullPath = serverVar('SCRIPT_FILENAME');\r
- }\r
+ if ($fullPath == '') {\r
+ $fullPath = serverVar('SCRIPT_FILENAME');\r
+ }\r
\r
- $basePath = str_replace('install.php', '', $fullPath);\r
- $basePath = replaceDoubleBackslash($basePath);\r
- $basePath = replaceDoubleBackslash($basePath);\r
+ $basePath = str_replace('install.php', '', $fullPath);\r
+ $basePath = replaceDoubleBackslash($basePath);\r
+ $basePath = replaceDoubleBackslash($basePath);\r
\r
- // add slash at end if necessary\r
- if (!endsWithSlash($basePath) ) {\r
- $basePath .= '/';\r
- }\r
- */\r
+ // add slash at end if necessary\r
+ if (!endsWithSlash($basePath) ) {\r
+ $basePath .= '/';\r
+ }\r
+ */\r
\r
- $basePath = dirname(__FILE__) . '/';\r
+ $basePath = dirname(__FILE__) . '/';\r
?>\r
\r
- <fieldset>\r
- <legend><?php echo _TEXT5_TAB_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD1; ?></td>\r
- <td><input name="IndexURL" size="60" value="<?php\r
- $url = 'http://' . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
- $url = str_replace('install.php', '', $url);\r
- $url = replaceDoubleBackslash($url);\r
-\r
- // add slash at end if necessary\r
- if (!endsWithSlash($url) ) {\r
- $url .= '/';\r
- }\r
-\r
- echo $url; ?>" tabindex="10080" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD2; ?></td>\r
- <td><input name="AdminURL" size="60" value="<?php\r
- if ($url) {\r
- echo $url . 'nucleus/';\r
- } ?>" tabindex="10090" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD3; ?></td>\r
- <td><input name="AdminPath" size="60" value="<?php\r
- if($basePath) {\r
- echo $basePath . 'nucleus/';\r
- } ?>" tabindex="10100" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD4; ?></td>\r
- <td><input name="MediaURL" size="60" value="<?php\r
- if ($url) {\r
- echo $url . 'media/';\r
- } ?>" tabindex="10110" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD5; ?></td>\r
- <td><input name="MediaPath" size="60" value="<?php\r
- if ($basePath) {\r
- echo $basePath . 'media/';\r
- } ?>" tabindex="10120" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD6; ?></td>\r
- <td><input name="SkinsURL" size="60" value="<?php\r
- if ($url) {\r
- echo $url . 'skins/';\r
- } ?>" tabindex="10130" />\r
- <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
- </td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD7; ?></td>\r
- <td><input name="SkinsPath" size="60" value="<?php\r
- if ($basePath) {\r
- echo $basePath . 'skins/';\r
- } ?>" tabindex="10140" />\r
- <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
- </td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD8; ?></td>\r
- <td><input name="PluginURL" size="60" value="<?php\r
- if ($url) {\r
- echo $url . 'nucleus/plugins/';\r
- } ?>" tabindex="10150" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT5_TAB_FIELD9; ?></td>\r
- <td><input name="ActionURL" size="60" value="<?php\r
- if ($url) {\r
- echo $url . 'action.php';\r
- } ?>" tabindex="10160" />\r
- <br />(<?php echo _TEXT5_TAB_FIELD9_2;?>)\r
- </td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <?php echo _TEXT5_2; ?>\r
-\r
- <h1><? echo _HEADER6; ?></h1>\r
-\r
- <?php echo _TEXT6; ?>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT6_TAB_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><?php echo _TEXT6_TAB_FIELD1; ?></td>\r
- <td><input name="User_name" value="" tabindex="10170" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT6_TAB_FIELD2; ?></td>\r
- <td><input name="User_realname" value="" tabindex="10180" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT6_TAB_FIELD3; ?></td>\r
- <td><input name="User_password" type="password" value="" tabindex="10190" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT6_TAB_FIELD4; ?></td>\r
- <td><input name="User_password2" type="password" value="" tabindex="10200" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT6_TAB_FIELD5; ?></td>\r
- <td><input name="User_email" value="" tabindex="10210" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <h1><?php echo _HEADER7; ?></h1>\r
-\r
- <?php echo _TEXT7; ?>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT7_TAB_HEAD; ?></legend>\r
- <table>\r
- <tr>\r
- <td><?php echo _TEXT7_TAB_FIELD1; ?></td>\r
- <td><input name="Blog_name" size="60" value="My Nucleus CMS" tabindex="10220" /></td>\r
- </tr>\r
- <tr>\r
- <td><?php echo _TEXT7_TAB_FIELD2; ?></td>\r
- <td><input name="Blog_shortname" value="mynucleuscms" tabindex="10230" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <h1><?php echo _HEADER8; ?></h1>\r
-\r
- <fieldset>\r
- <legend><?php echo _TEXT8_TAB_HEADER; ?></legend>\r
- <table>\r
- <tr>\r
- <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" tabindex="10240" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
- </tr>\r
- </table>\r
- </fieldset>\r
-\r
- <h1><?php echo _HEADER9; ?></h1>\r
-\r
- <?php echo _TEXT9; ?>\r
-\r
- <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" tabindex="10250" /></p>\r
-\r
- </form>\r
- </body>\r
+ <fieldset>\r
+ <legend><?php echo _TEXT5_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD1; ?></td>\r
+ <td><input name="IndexURL" size="60" value="<?php\r
+ $url = 'http://' . serverVar('HTTP_HOST') . serverVar('PHP_SELF');\r
+ $url = str_replace('install.php', '', $url);\r
+ $url = replaceDoubleBackslash($url);\r
+\r
+ // add slash at end if necessary\r
+ if (!endsWithSlash($url) ) {\r
+ $url .= '/';\r
+ }\r
+\r
+ echo $url; ?>" tabindex="10080" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD2; ?></td>\r
+ <td><input name="AdminURL" size="60" value="<?php\r
+ if ($url) {\r
+ echo $url . 'nucleus/';\r
+ } ?>" tabindex="10090" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD3; ?></td>\r
+ <td><input name="AdminPath" size="60" value="<?php\r
+ if($basePath) {\r
+ echo $basePath . 'nucleus/';\r
+ } ?>" tabindex="10100" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD4; ?></td>\r
+ <td><input name="MediaURL" size="60" value="<?php\r
+ if ($url) {\r
+ echo $url . 'media/';\r
+ } ?>" tabindex="10110" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD5; ?></td>\r
+ <td><input name="MediaPath" size="60" value="<?php\r
+ if ($basePath) {\r
+ echo $basePath . 'media/';\r
+ } ?>" tabindex="10120" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD6; ?></td>\r
+ <td><input name="SkinsURL" size="60" value="<?php\r
+ if ($url) {\r
+ echo $url . 'skins/';\r
+ } ?>" tabindex="10130" />\r
+ <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD7; ?></td>\r
+ <td><input name="SkinsPath" size="60" value="<?php\r
+ if ($basePath) {\r
+ echo $basePath . 'skins/';\r
+ } ?>" tabindex="10140" />\r
+ <br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
+ </td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD8; ?></td>\r
+ <td><input name="PluginURL" size="60" value="<?php\r
+ if ($url) {\r
+ echo $url . 'nucleus/plugins/';\r
+ } ?>" tabindex="10150" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT5_TAB_FIELD9; ?></td>\r
+ <td><input name="ActionURL" size="60" value="<?php\r
+ if ($url) {\r
+ echo $url . 'action.php';\r
+ } ?>" tabindex="10160" />\r
+ <br />(<?php echo _TEXT5_TAB_FIELD9_2;?>)\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <?php echo _TEXT5_2; ?>\r
+\r
+ <h1><? echo _HEADER6; ?></h1>\r
+\r
+ <?php echo _TEXT6; ?>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT6_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT6_TAB_FIELD1; ?></td>\r
+ <td><input name="User_name" value="" tabindex="10170" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT6_TAB_FIELD2; ?></td>\r
+ <td><input name="User_realname" value="" tabindex="10180" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT6_TAB_FIELD3; ?></td>\r
+ <td><input name="User_password" type="password" value="" tabindex="10190" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT6_TAB_FIELD4; ?></td>\r
+ <td><input name="User_password2" type="password" value="" tabindex="10200" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT6_TAB_FIELD5; ?></td>\r
+ <td><input name="User_email" value="" tabindex="10210" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <h1><?php echo _HEADER7; ?></h1>\r
+\r
+ <?php echo _TEXT7; ?>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT7_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT7_TAB_FIELD1; ?></td>\r
+ <td><input name="Blog_name" size="60" value="My Nucleus CMS" tabindex="10220" /></td>\r
+ </tr>\r
+ <tr>\r
+ <td><?php echo _TEXT7_TAB_FIELD2; ?></td>\r
+ <td><input name="Blog_shortname" value="mynucleuscms" tabindex="10230" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <h1><?php echo _HEADER8; ?></h1>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT8_TAB_HEADER; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" tabindex="10240" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
+ <h1><?php echo _HEADER9; ?></h1>\r
+\r
+ <?php echo _TEXT9; ?>\r
+\r
+ <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" tabindex="10250" /></p>\r
+\r
+ </form>\r
+ </body>\r
</html>\r
\r
<?php }\r
\r
function tableName($unPrefixed) {\r
- global $mysql_usePrefix, $mysql_prefix;\r
+ global $mysql_usePrefix, $mysql_prefix;\r
\r
- if ($mysql_usePrefix == 1) {\r
- return $mysql_prefix . $unPrefixed;\r
- } else {\r
- return $unPrefixed;\r
- }\r
+ if ($mysql_usePrefix == 1) {\r
+ return $mysql_prefix . $unPrefixed;\r
+ } else {\r
+ return $unPrefixed;\r
+ }\r
}\r
\r
function doInstall() {\r
- global $mysql_usePrefix, $mysql_prefix, $weblog_ping;\r
-\r
- // 0. put all POST-vars into vars\r
- $mysql_host = postVar('mySQL_host');\r
- $mysql_user = postVar('mySQL_user');\r
- $mysql_password = postVar('mySQL_password');\r
- $mysql_database = postVar('mySQL_database');\r
- $mysql_create = postVar('mySQL_create');\r
- $mysql_usePrefix = postVar('mySQL_usePrefix');\r
- $mysql_prefix = postVar('mySQL_tablePrefix');\r
- $config_indexurl = postVar('IndexURL');\r
- $config_adminurl = postVar('AdminURL');\r
- $config_adminpath = postVar('AdminPath');\r
- $config_mediaurl = postVar('MediaURL');\r
- $config_skinsurl = postVar('SkinsURL');\r
- $config_pluginurl = postVar('PluginURL');\r
- $config_actionurl = postVar('ActionURL');\r
- $config_mediapath = postVar('MediaPath');\r
- $config_skinspath = postVar('SkinsPath');\r
- $user_name = postVar('User_name');\r
- $user_realname = postVar('User_realname');\r
- $user_password = postVar('User_password');\r
- $user_password2 = postVar('User_password2');\r
- $user_email = postVar('User_email');\r
- $blog_name = postVar('Blog_name');\r
- $blog_shortname = postVar('Blog_shortname');\r
- $charset = postVar('charset');\r
- $config_adminemail = $user_email;\r
- $config_sitename = $blog_name;\r
- $weblog_ping = postVar('Weblog_ping');\r
-\r
- $_POST = array();\r
- if (!extension_loaded('mbstring')) {\r
- include('nucleus/libs/mb_emulator/mb-emulator.php');\r
- }\r
- if ($charset == 'ujis') {\r
- define('_CHARSET', 'EUC-JP');\r
- $config_sitename = mb_convert_encoding($config_sitename, _CHARSET, 'UTF-8');\r
- $user_realname = mb_convert_encoding($user_realname, _CHARSET, 'UTF-8');\r
- $blog_name = mb_convert_encoding($blog_name, _CHARSET, 'UTF-8');\r
- } else {\r
- define('_CHARSET', 'UTF-8');\r
- }\r
-\r
- $config_indexurl = replaceDoubleBackslash($config_indexurl);\r
- $config_adminurl = replaceDoubleBackslash($config_adminurl);\r
- $config_mediaurl = replaceDoubleBackslash($config_mediaurl);\r
- $config_skinsurl = replaceDoubleBackslash($config_skinsurl);\r
- $config_pluginurl = replaceDoubleBackslash($config_pluginurl);\r
- $config_actionurl = replaceDoubleBackslash($config_actionurl);\r
- $config_adminpath = replaceDoubleBackslash($config_adminpath);\r
- $config_skinspath = replaceDoubleBackslash($config_skinspath);\r
- $config_mediapath = replaceDoubleBackslash($config_mediapath);\r
-\r
- // 1. check all the data\r
- $errors = array();\r
-\r
- if (!$mysql_database) {\r
- array_push($errors, _ERROR2);\r
- }\r
-\r
- if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0) ) {\r
- array_push($errors, _ERROR3);\r
- }\r
-\r
- if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
- array_push($errors, _ERROR4);\r
- }\r
-\r
- // TODO: add action.php check\r
- if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl) || !endsWithSlash($config_mediaurl) || !endsWithSlash($config_pluginurl) || !endsWithSlash($config_skinsurl) ) {\r
- array_push($errors, _ERROR5);\r
- }\r
-\r
- if (!endsWithSlash($config_adminpath) ) {\r
- array_push($errors, _ERROR6);\r
- }\r
-\r
- if (!endsWithSlash($config_mediapath) ) {\r
- array_push($errors, _ERROR7);\r
- }\r
-\r
- if (!endsWithSlash($config_skinspath) ) {\r
- array_push($errors, _ERROR8);\r
- }\r
-\r
- if (!is_dir($config_adminpath) ) {\r
- array_push($errors, _ERROR9);\r
- }\r
-\r
- if (!_isValidMailAddress($user_email) ) {\r
- array_push($errors, _ERROR10);\r
- }\r
-\r
- if (!_isValidDisplayName($user_name) ) {\r
- array_push($errors, _ERROR11);\r
- }\r
-\r
- if (!$user_password || !$user_password2) {\r
- array_push($errors, _ERROR12);\r
- }\r
-\r
- if ($user_password != $user_password2) {\r
- array_push($errors, _ERROR13);\r
- }\r
-\r
- if (!_isValidShortName($blog_shortname) ) {\r
- array_push($errors, _ERROR14);\r
- }\r
-\r
- if (sizeof($errors) > 0) {\r
- showErrorMessages($errors);\r
- }\r
-\r
- // 2-1. try to log in to mySQL\r
-\r
- global $MYSQL_CONN;\r
- // this will need to be changed if we ever allow\r
- $MYSQL_CONN = @sql_connect_args($mysql_host, $mysql_user, $mysql_password);\r
-\r
- if ($MYSQL_CONN == false) {\r
- _doError(_ERROR15 . ': ' . sql_error() );\r
- }\r
+ global $mysql_usePrefix, $mysql_prefix, $weblog_ping;\r
+\r
+ // 0. put all POST-vars into vars\r
+ $mysql_host = postVar('mySQL_host');\r
+ $mysql_user = postVar('mySQL_user');\r
+ $mysql_password = postVar('mySQL_password');\r
+ $mysql_database = postVar('mySQL_database');\r
+ $mysql_create = postVar('mySQL_create');\r
+ $mysql_usePrefix = postVar('mySQL_usePrefix');\r
+ $mysql_prefix = postVar('mySQL_tablePrefix');\r
+ $config_indexurl = postVar('IndexURL');\r
+ $config_adminurl = postVar('AdminURL');\r
+ $config_adminpath = postVar('AdminPath');\r
+ $config_mediaurl = postVar('MediaURL');\r
+ $config_skinsurl = postVar('SkinsURL');\r
+ $config_pluginurl = postVar('PluginURL');\r
+ $config_actionurl = postVar('ActionURL');\r
+ $config_mediapath = postVar('MediaPath');\r
+ $config_skinspath = postVar('SkinsPath');\r
+ $user_name = postVar('User_name');\r
+ $user_realname = postVar('User_realname');\r
+ $user_password = postVar('User_password');\r
+ $user_password2 = postVar('User_password2');\r
+ $user_email = postVar('User_email');\r
+ $blog_name = postVar('Blog_name');\r
+ $blog_shortname = postVar('Blog_shortname');\r
+ $charset = postVar('charset');\r
+ $config_adminemail = $user_email;\r
+ $config_sitename = $blog_name;\r
+ $weblog_ping = postVar('Weblog_ping');\r
+\r
+ $_POST = array();\r
+ if (!extension_loaded('mbstring')) {\r
+ include('nucleus/libs/mb_emulator/mb-emulator.php');\r
+ }\r
+ if ($charset == 'ujis') {\r
+ define('_CHARSET', 'EUC-JP');\r
+ $config_sitename = mb_convert_encoding($config_sitename, _CHARSET, 'UTF-8');\r
+ $user_realname = mb_convert_encoding($user_realname, _CHARSET, 'UTF-8');\r
+ $blog_name = mb_convert_encoding($blog_name, _CHARSET, 'UTF-8');\r
+ } else {\r
+ define('_CHARSET', 'UTF-8');\r
+ }\r
+\r
+ $config_indexurl = replaceDoubleBackslash($config_indexurl);\r
+ $config_adminurl = replaceDoubleBackslash($config_adminurl);\r
+ $config_mediaurl = replaceDoubleBackslash($config_mediaurl);\r
+ $config_skinsurl = replaceDoubleBackslash($config_skinsurl);\r
+ $config_pluginurl = replaceDoubleBackslash($config_pluginurl);\r
+ $config_actionurl = replaceDoubleBackslash($config_actionurl);\r
+ $config_adminpath = replaceDoubleBackslash($config_adminpath);\r
+ $config_skinspath = replaceDoubleBackslash($config_skinspath);\r
+ $config_mediapath = replaceDoubleBackslash($config_mediapath);\r
+\r
+ // 1. check all the data\r
+ $errors = array();\r
+\r
+ if (!$mysql_database) {\r
+ array_push($errors, _ERROR2);\r
+ }\r
+\r
+ if (($mysql_usePrefix == 1) && (strlen($mysql_prefix) == 0) ) {\r
+ array_push($errors, _ERROR3);\r
+ }\r
+\r
+ if (($mysql_usePrefix == 1) && (!eregi('^[a-zA-Z0-9_]+$', $mysql_prefix) ) ) {\r
+ array_push($errors, _ERROR4);\r
+ }\r
+\r
+ // TODO: add action.php check\r
+ if (!endsWithSlash($config_indexurl) || !endsWithSlash($config_adminurl) || !endsWithSlash($config_mediaurl) || !endsWithSlash($config_pluginurl) || !endsWithSlash($config_skinsurl) ) {\r
+ array_push($errors, _ERROR5);\r
+ }\r
+\r
+ if (!endsWithSlash($config_adminpath) ) {\r
+ array_push($errors, _ERROR6);\r
+ }\r
+\r
+ if (!endsWithSlash($config_mediapath) ) {\r
+ array_push($errors, _ERROR7);\r
+ }\r
+\r
+ if (!endsWithSlash($config_skinspath) ) {\r
+ array_push($errors, _ERROR8);\r
+ }\r
+\r
+ if (!is_dir($config_adminpath) ) {\r
+ array_push($errors, _ERROR9);\r
+ }\r
+\r
+ if (!_isValidMailAddress($user_email) ) {\r
+ array_push($errors, _ERROR10);\r
+ }\r
+\r
+ if (!_isValidDisplayName($user_name) ) {\r
+ array_push($errors, _ERROR11);\r
+ }\r
+\r
+ if (!$user_password || !$user_password2) {\r
+ array_push($errors, _ERROR12);\r
+ }\r
+\r
+ if ($user_password != $user_password2) {\r
+ array_push($errors, _ERROR13);\r
+ }\r
+\r
+ if (!_isValidShortName($blog_shortname) ) {\r
+ array_push($errors, _ERROR14);\r
+ }\r
+\r
+ if (sizeof($errors) > 0) {\r
+ showErrorMessages($errors);\r
+ }\r
+\r
+ // 2-1. try to log in to mySQL\r
+\r
+ global $MYSQL_CONN;\r
+ // this will need to be changed if we ever allow\r
+ $MYSQL_CONN = @sql_connect_args($mysql_host, $mysql_user, $mysql_password);\r
+\r
+ if ($MYSQL_CONN == false) {\r
+ _doError(_ERROR15 . ': ' . sql_error() );\r
+ }\r
\r
// <add for garble measure>\r
- // 2-2. set DEFAULT CHARSET and COLLATE\r
- $mySqlVer = implode('.', array_map('intval', explode('.', mysql_get_server_info($MYSQL_CONN))));\r
- if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
- mysql_set_charset($charset);\r
- } elseif ($mySqlVer >= '4.1.0') {\r
- sql_query("SET NAMES " . $charset);\r
- }\r
- $collation = ($charset == 'utf8') ? 'utf8_unicode_ci' : 'ujis_japanese_ci';\r
+ // 2-2. set DEFAULT CHARSET and COLLATE\r
+ $mySqlVer = implode('.', array_map('intval', explode('.', mysql_get_server_info($MYSQL_CONN))));\r
+ if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
+ mysql_set_charset($charset);\r
+ } elseif ($mySqlVer >= '4.1.0') {\r
+ sql_query("SET NAMES " . $charset);\r
+ }\r
+ $collation = ($charset == 'utf8') ? 'utf8_unicode_ci' : 'ujis_japanese_ci';\r
// </add for garble measure>*/\r
\r
- // 3. try to create database (if needed)\r
- if ($mysql_create == 1) {\r
- $sql = 'CREATE DATABASE '\r
- . $mysql_database;\r
+ // 3. try to create database (if needed)\r
+ if ($mysql_create == 1) {\r
+ $sql = 'CREATE DATABASE '\r
+ . $mysql_database;\r
// <add for garble measure>\r
- if ($mySqlVer >= '4.1.0') {\r
- $sql .= ' DEFAULT CHARACTER SET '\r
- . $charset\r
- . ' COLLATE '\r
- . $collation;\r
- }\r
+ if ($mySqlVer >= '4.1.0') {\r
+ $sql .= ' DEFAULT CHARACTER SET '\r
+ . $charset\r
+ . ' COLLATE '\r
+ . $collation;\r
+ }\r
// </add for garble measure>*/\r
- sql_query($sql,$MYSQL_CONN) or _doError(_ERROR16 . ': ' . sql_error($MYSQL_CONN));\r
- }\r
-\r
- // 4. try to select database\r
- sql_select_db($mysql_database,$MYSQL_CONN) or _doError(_ERROR17);\r
-\r
- // 5. execute queries\r
- $filename = 'install.sql';\r
- $fd = fopen($filename, 'r');\r
- $queries = fread($fd, filesize($filename) );\r
- fclose($fd);\r
-\r
- $queries = split("(;\n|;\r)", $queries);\r
-\r
- $aTableNames = array(\r
- 'nucleus_actionlog',\r
- 'nucleus_ban',\r
- 'nucleus_blog',\r
- 'nucleus_category',\r
- 'nucleus_comment',\r
- 'nucleus_config',\r
- 'nucleus_item',\r
- 'nucleus_karma',\r
- 'nucleus_member',\r
- 'nucleus_plugin',\r
- 'nucleus_skin',\r
- 'nucleus_template',\r
- 'nucleus_team',\r
- 'nucleus_activation',\r
- 'nucleus_tickets'\r
- );\r
+ sql_query($sql,$MYSQL_CONN) or _doError(_ERROR16 . ': ' . sql_error($MYSQL_CONN));\r
+ }\r
+\r
+ // 4. try to select database\r
+ sql_select_db($mysql_database,$MYSQL_CONN) or _doError(_ERROR17);\r
+\r
+ // 5. execute queries\r
+ $filename = 'install.sql';\r
+ $fd = fopen($filename, 'r');\r
+ $queries = fread($fd, filesize($filename) );\r
+ fclose($fd);\r
+\r
+ $queries = split("(;\n|;\r)", $queries);\r
+\r
+ $aTableNames = array(\r
+ 'nucleus_actionlog',\r
+ 'nucleus_ban',\r
+ 'nucleus_blog',\r
+ 'nucleus_category',\r
+ 'nucleus_comment',\r
+ 'nucleus_config',\r
+ 'nucleus_item',\r
+ 'nucleus_karma',\r
+ 'nucleus_member',\r
+ 'nucleus_plugin',\r
+ 'nucleus_skin',\r
+ 'nucleus_template',\r
+ 'nucleus_team',\r
+ 'nucleus_activation',\r
+ 'nucleus_tickets'\r
+ );\r
// these are unneeded (one of the replacements above takes care of them)\r
// 'nucleus_plugin_event',\r
// 'nucleus_plugin_option',\r
// 'nucleus_skin_desc',\r
// 'nucleus_template_desc',\r
\r
- $aTableNamesPrefixed = array(\r
- $mysql_prefix . 'nucleus_actionlog',\r
- $mysql_prefix . 'nucleus_ban',\r
- $mysql_prefix . 'nucleus_blog',\r
- $mysql_prefix . 'nucleus_category',\r
- $mysql_prefix . 'nucleus_comment',\r
- $mysql_prefix . 'nucleus_config',\r
- $mysql_prefix . 'nucleus_item',\r
- $mysql_prefix . 'nucleus_karma',\r
- $mysql_prefix . 'nucleus_member',\r
- $mysql_prefix . 'nucleus_plugin',\r
- $mysql_prefix . 'nucleus_skin',\r
- $mysql_prefix . 'nucleus_template',\r
- $mysql_prefix . 'nucleus_team',\r
- $mysql_prefix . 'nucleus_activation',\r
- $mysql_prefix . 'nucleus_tickets'\r
- );\r
+ $aTableNamesPrefixed = array(\r
+ $mysql_prefix . 'nucleus_actionlog',\r
+ $mysql_prefix . 'nucleus_ban',\r
+ $mysql_prefix . 'nucleus_blog',\r
+ $mysql_prefix . 'nucleus_category',\r
+ $mysql_prefix . 'nucleus_comment',\r
+ $mysql_prefix . 'nucleus_config',\r
+ $mysql_prefix . 'nucleus_item',\r
+ $mysql_prefix . 'nucleus_karma',\r
+ $mysql_prefix . 'nucleus_member',\r
+ $mysql_prefix . 'nucleus_plugin',\r
+ $mysql_prefix . 'nucleus_skin',\r
+ $mysql_prefix . 'nucleus_template',\r
+ $mysql_prefix . 'nucleus_team',\r
+ $mysql_prefix . 'nucleus_activation',\r
+ $mysql_prefix . 'nucleus_tickets'\r
+ );\r
// these are unneeded (one of the replacements above takes care of them)\r
// $mysql_prefix . 'nucleus_plugin_event',\r
// $mysql_prefix . 'nucleus_plugin_option',\r
// $mysql_prefix . 'nucleus_skin_desc',\r
// $mysql_prefix . 'nucleus_template_desc',\r
\r
- $count = count($queries);\r
+ $count = count($queries);\r
\r
- for ($idx = 0; $idx < $count; $idx++) {\r
- $query = trim($queries[$idx]);\r
- // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
+ for ($idx = 0; $idx < $count; $idx++) {\r
+ $query = trim($queries[$idx]);\r
+ // echo "QUERY = <small>" . htmlspecialchars($query) . "</small><p>";\r
\r
- if ($query) {\r
+ if ($query) {\r
\r
- if ($mysql_usePrefix == 1) {\r
- $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
- }\r
+ if ($mysql_usePrefix == 1) {\r
+ $query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
+ }\r
// <add for garble measure>\r
- if ($mysql_create != 1 && strpos($query, 'CREATE TABLE') === 0 && $mySqlVer >= '4.1.0') {\r
- $query .= ' DEFAULT CHARACTER SET ' . $charset . ' COLLATE ' . $collation;\r
- }\r
+ if ($mysql_create != 1 && strpos($query, 'CREATE TABLE') === 0 && $mySqlVer >= '4.1.0') {\r
+ $query .= ' DEFAULT CHARACTER SET ' . $charset . ' COLLATE ' . $collation;\r
+ }\r
// </add for garble measure>*/\r
\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($query) . '</small>): ' . sql_error($MYSQL_CONN) );\r
- }\r
- }\r
-\r
- // 5a make first post\r
- if ($charset == 'ujis') {\r
- $itm_title = mb_convert_encoding(_1ST_POST_TITLE, _CHARSET, 'UTF-8');\r
- $itm_body = mb_convert_encoding(_1ST_POST, _CHARSET, 'UTF-8');\r
- $itm_more = mb_convert_encoding(_1ST_POST2, _CHARSET, 'UTF-8');\r
- } else {\r
- $itm_title = _1ST_POST_TITLE;\r
- $itm_body = _1ST_POST;\r
- $itm_more = _1ST_POST2;\r
- }\r
- $newpost = "INSERT INTO "\r
- . tableName('nucleus_item')\r
- . " VALUES ("\r
- . "1, "\r
- . "'" . $itm_title . "',"\r
- . " '" . $itm_body . "',"\r
- . " '" . $itm_more . "',"\r
- . " 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
- sql_query($newpost,$MYSQL_CONN) or _doError(_ERROR18 . ' (<small>' . htmlspecialchars($newpost) . '</small>): ' . sql_error($MYSQL_CONN) );\r
-\r
- // 6. update global settings\r
- updateConfig('IndexURL', $config_indexurl);\r
- updateConfig('AdminURL', $config_adminurl);\r
- updateConfig('MediaURL', $config_mediaurl);\r
- updateConfig('SkinsURL', $config_skinsurl);\r
- updateConfig('PluginURL', $config_pluginurl);\r
- updateConfig('ActionURL', $config_actionurl);\r
- updateConfig('AdminEmail', $config_adminemail);\r
- updateConfig('SiteName', $config_sitename);\r
- if ($charset == 'ujis') {\r
- updateConfig('Language', 'japanese-euc');\r
- }\r
-\r
- // 7. update GOD member\r
- $query = 'UPDATE ' . tableName('nucleus_member')\r
- . " SET mname = '" . addslashes($user_name) . "',"\r
- . " mrealname = '" . addslashes($user_realname) . "',"\r
- . " mpassword = '" . md5(addslashes($user_password) ) . "',"\r
- . " murl = '" . addslashes($config_indexurl) . "',"\r
- . " memail = '" . addslashes($user_email) . "',"\r
- . " madmin = 1,"\r
- . " mcanlogin = 1"\r
- . " WHERE"\r
- . " mnumber = 1";\r
-\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR19 . ': ' . sql_error($MYSQL_CONN) );\r
-\r
- // 8. update weblog settings\r
- $query = 'UPDATE ' . tableName('nucleus_blog')\r
- . " SET bname = '" . addslashes($blog_name) . "',"\r
- . " bshortname = '" . addslashes($blog_shortname) . "',"\r
- . " burl = '" . addslashes($config_indexurl) . "'"\r
- . " WHERE"\r
- . " bnumber = 1";\r
-\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) );\r
-\r
- // 8-2. update category settings\r
- if ($charset == 'ujis') {\r
- $cat_name = mb_convert_encoding(_GENERALCAT_NAME, _CHARSET, 'UTF-8');\r
- $cat_desc = mb_convert_encoding(_GENERALCAT_DESC, _CHARSET, 'UTF-8');\r
- } else {\r
- $cat_name = _GENERALCAT_NAME;\r
- $cat_desc = _GENERALCAT_DESC;\r
- }\r
- $query = 'UPDATE ' . tableName('nucleus_category')\r
- . " SET cname = '" . $cat_name . "',"\r
- . " cdesc = '" . $cat_desc . "'"\r
- . " WHERE"\r
- . " catid = 1";\r
-\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) );\r
-\r
- // 9. update item date\r
- $query = 'UPDATE ' . tableName('nucleus_item')\r
- . " SET itime = '" . date('Y-m-d H:i:s', time() ) ."'"\r
- . " WHERE inumber = 1";\r
-\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR21 . ': ' . sql_error($MYSQL_CONN) );\r
-\r
- global $aConfPlugsToInstall, $aConfSkinsToImport;\r
- $aSkinErrors = array();\r
- $aPlugErrors = array();\r
-\r
- if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
- // 10. set global variables\r
- global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
-\r
- $MYSQL_HOST = $mysql_host;\r
- $MYSQL_USER = $mysql_user;\r
- $MYSQL_PASSWORD = $mysql_password;\r
- $MYSQL_DATABASE = $mysql_database;\r
- $MYSQL_PREFIX = ($mysql_usePrefix == 1) ? $mysql_prefix : '';\r
-\r
- global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
-\r
- $DIR_NUCLEUS = $config_adminpath;\r
- $DIR_MEDIA = $config_mediapath;\r
- $DIR_SKINS = $config_skinspath;\r
- $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
- $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
- $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
-\r
- // close database connection (needs to be closed if we want to include globalfunctions.php)\r
- sql_close($MYSQL_CONN);\r
-\r
- $manager = '';\r
- include_once($DIR_LIBS . 'globalfunctions.php');\r
-\r
- // 11. install custom skins\r
- $aSkinErrors = installCustomSkins($manager);\r
-\r
- // 12. install NP_Ping, if decided\r
- if ($weblog_ping == 1) {\r
- global $aConfPlugsToInstall;\r
- array_push($aConfPlugsToInstall, "NP_Ping");\r
- }\r
-\r
- // 13. install custom plugins\r
- $aPlugErrors = installCustomPlugs($manager);\r
- }\r
-\r
- // 14. Write config file ourselves (if possible)\r
- $bConfigWritten = 0;\r
-\r
- if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w') ) {\r
- $config_data = '<' . '?php' . "\n\n";\r
- //$config_data .= "\n"; (extraneous, just added extra \n to previous line\r
- $config_data .= " // mySQL connection information\n";\r
- $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n";\r
- $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n";\r
- $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
- $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
- $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1) ? $mysql_prefix : '') . "';\n";\r
- $config_data .= " // new in 3.50. first element is db handler, the second is the db driver used by the handler\n";\r
- $config_data .= " // default is \$MYSQL_HANDLER = array('mysql','mysql');\n";\r
- $config_data .= " //\$MYSQL_HANDLER = array('mysql','mysql');\n";\r
- $config_data .= " //\$MYSQL_HANDLER = array('pdo','mysql');\n";\r
- $config_data .= " \$MYSQL_HANDLER = array('".$MYSQL_HANDLER[0]."','".$MYSQL_HANDLER[1]."');\n";\r
- $config_data .= "\n";\r
- $config_data .= " // main nucleus directory\n";\r
- $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
- $config_data .= "\n";\r
- $config_data .= " // path to media dir\n";\r
- $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n";\r
- $config_data .= "\n";\r
- $config_data .= " // extra skin files for imported skins\n";\r
- $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n";\r
- $config_data .= "\n";\r
- $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n";\r
- $config_data .= " // you can redefine them if you wish\n";\r
- $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
- $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n";\r
- $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n";\r
- $config_data .= "\n";\r
- $config_data .= " // include libs\n";\r
- $config_data .= " include(\$DIR_LIBS . 'globalfunctions.php');\n";\r
- $config_data .= " if (!extension_loaded('mbstring')) {\n";\r
- $config_data .= " include(\$DIR_LIBS . 'mb_emulator/mb-emulator.php');\n";\r
- $config_data .= " }\n";\r
- $config_data .= "?" . ">";\r
-\r
- $result = @fputs($fp, $config_data, strlen($config_data) );\r
- fclose($fp);\r
-\r
- if ($result) {\r
- $bConfigWritten = 1;\r
- }\r
- }\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($query) . '</small>): ' . sql_error($MYSQL_CONN) );\r
+ }\r
+ }\r
+\r
+ // 5a make first post\r
+ if ($charset == 'ujis') {\r
+ $itm_title = mb_convert_encoding(_1ST_POST_TITLE, _CHARSET, 'UTF-8');\r
+ $itm_body = mb_convert_encoding(_1ST_POST, _CHARSET, 'UTF-8');\r
+ $itm_more = mb_convert_encoding(_1ST_POST2, _CHARSET, 'UTF-8');\r
+ } else {\r
+ $itm_title = _1ST_POST_TITLE;\r
+ $itm_body = _1ST_POST;\r
+ $itm_more = _1ST_POST2;\r
+ }\r
+ $newpost = "INSERT INTO "\r
+ . tableName('nucleus_item')\r
+ . " VALUES ("\r
+ . "1, "\r
+ . "'" . $itm_title . "',"\r
+ . " '" . $itm_body . "',"\r
+ . " '" . $itm_more . "',"\r
+ . " 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
+ sql_query($newpost,$MYSQL_CONN) or _doError(_ERROR18 . ' (<small>' . htmlspecialchars($newpost) . '</small>): ' . sql_error($MYSQL_CONN) );\r
+\r
+ // 6. update global settings\r
+ updateConfig('IndexURL', $config_indexurl);\r
+ updateConfig('AdminURL', $config_adminurl);\r
+ updateConfig('MediaURL', $config_mediaurl);\r
+ updateConfig('SkinsURL', $config_skinsurl);\r
+ updateConfig('PluginURL', $config_pluginurl);\r
+ updateConfig('ActionURL', $config_actionurl);\r
+ updateConfig('AdminEmail', $config_adminemail);\r
+ updateConfig('SiteName', $config_sitename);\r
+ if ($charset == 'ujis') {\r
+ updateConfig('Language', 'japanese-euc');\r
+ }\r
+\r
+ // 7. update GOD member\r
+ $query = 'UPDATE ' . tableName('nucleus_member')\r
+ . " SET mname = '" . addslashes($user_name) . "',"\r
+ . " mrealname = '" . addslashes($user_realname) . "',"\r
+ . " mpassword = '" . md5(addslashes($user_password) ) . "',"\r
+ . " murl = '" . addslashes($config_indexurl) . "',"\r
+ . " memail = '" . addslashes($user_email) . "',"\r
+ . " madmin = 1,"\r
+ . " mcanlogin = 1"\r
+ . " WHERE"\r
+ . " mnumber = 1";\r
+\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR19 . ': ' . sql_error($MYSQL_CONN) );\r
+\r
+ // 8. update weblog settings\r
+ $query = 'UPDATE ' . tableName('nucleus_blog')\r
+ . " SET bname = '" . addslashes($blog_name) . "',"\r
+ . " bshortname = '" . addslashes($blog_shortname) . "',"\r
+ . " burl = '" . addslashes($config_indexurl) . "'"\r
+ . " WHERE"\r
+ . " bnumber = 1";\r
+\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) );\r
+\r
+ // 8-2. update category settings\r
+ if ($charset == 'ujis') {\r
+ $cat_name = mb_convert_encoding(_GENERALCAT_NAME, _CHARSET, 'UTF-8');\r
+ $cat_desc = mb_convert_encoding(_GENERALCAT_DESC, _CHARSET, 'UTF-8');\r
+ } else {\r
+ $cat_name = _GENERALCAT_NAME;\r
+ $cat_desc = _GENERALCAT_DESC;\r
+ }\r
+ $query = 'UPDATE ' . tableName('nucleus_category')\r
+ . " SET cname = '" . $cat_name . "',"\r
+ . " cdesc = '" . $cat_desc . "'"\r
+ . " WHERE"\r
+ . " catid = 1";\r
+\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) );\r
+\r
+ // 9. update item date\r
+ $query = 'UPDATE ' . tableName('nucleus_item')\r
+ . " SET itime = '" . date('Y-m-d H:i:s', time() ) ."'"\r
+ . " WHERE inumber = 1";\r
+\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR21 . ': ' . sql_error($MYSQL_CONN) );\r
+\r
+ global $aConfPlugsToInstall, $aConfSkinsToImport;\r
+ $aSkinErrors = array();\r
+ $aPlugErrors = array();\r
+\r
+ if ((count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) {\r
+ // 10. set global variables\r
+ global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX;\r
+\r
+ $MYSQL_HOST = $mysql_host;\r
+ $MYSQL_USER = $mysql_user;\r
+ $MYSQL_PASSWORD = $mysql_password;\r
+ $MYSQL_DATABASE = $mysql_database;\r
+ $MYSQL_PREFIX = ($mysql_usePrefix == 1) ? $mysql_prefix : '';\r
+\r
+ global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS;\r
+\r
+ $DIR_NUCLEUS = $config_adminpath;\r
+ $DIR_MEDIA = $config_mediapath;\r
+ $DIR_SKINS = $config_skinspath;\r
+ $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
+ $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
+ $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
+\r
+ // close database connection (needs to be closed if we want to include globalfunctions.php)\r
+ sql_close($MYSQL_CONN);\r
+\r
+ $manager = '';\r
+ include_once($DIR_LIBS . 'globalfunctions.php');\r
+\r
+ // 11. install custom skins\r
+ $aSkinErrors = installCustomSkins($manager);\r
+\r
+ // 12. install NP_Ping, if decided\r
+ if ($weblog_ping == 1) {\r
+ global $aConfPlugsToInstall;\r
+ array_push($aConfPlugsToInstall, "NP_Ping");\r
+ }\r
+\r
+ // 13. install custom plugins\r
+ $aPlugErrors = installCustomPlugs($manager);\r
+ }\r
+\r
+ // 14. Write config file ourselves (if possible)\r
+ $bConfigWritten = 0;\r
+\r
+ if (@file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w') ) {\r
+ $config_data = '<' . '?php' . "\n\n";\r
+ //$config_data .= "\n"; (extraneous, just added extra \n to previous line\r
+ $config_data .= " // mySQL connection information\n";\r
+ $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n";\r
+ $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n";\r
+ $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n";\r
+ $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n";\r
+ $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1) ? $mysql_prefix : '') . "';\n";\r
+ $config_data .= " // new in 3.50. first element is db handler, the second is the db driver used by the handler\n";\r
+ $config_data .= " // default is \$MYSQL_HANDLER = array('mysql','mysql');\n";\r
+ $config_data .= " //\$MYSQL_HANDLER = array('mysql','mysql');\n";\r
+ $config_data .= " //\$MYSQL_HANDLER = array('pdo','mysql');\n";\r
+ $config_data .= " \$MYSQL_HANDLER = array('".$MYSQL_HANDLER[0]."','".$MYSQL_HANDLER[1]."');\n";\r
+ $config_data .= "\n";\r
+ $config_data .= " // main nucleus directory\n";\r
+ $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n";\r
+ $config_data .= "\n";\r
+ $config_data .= " // path to media dir\n";\r
+ $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n";\r
+ $config_data .= "\n";\r
+ $config_data .= " // extra skin files for imported skins\n";\r
+ $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n";\r
+ $config_data .= "\n";\r
+ $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n";\r
+ $config_data .= " // you can redefine them if you wish\n";\r
+ $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n";\r
+ $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n";\r
+ $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n";\r
+ $config_data .= "\n";\r
+ $config_data .= " // include libs\n";\r
+ $config_data .= " include(\$DIR_LIBS . 'globalfunctions.php');\n";\r
+ $config_data .= " if (!extension_loaded('mbstring')) {\n";\r
+ $config_data .= " include(\$DIR_LIBS . 'mb_emulator/mb-emulator.php');\n";\r
+ $config_data .= " }\n";\r
+ $config_data .= "?" . ">";\r
+\r
+ $result = @fputs($fp, $config_data, strlen($config_data) );\r
+ fclose($fp);\r
+\r
+ if ($result) {\r
+ $bConfigWritten = 1;\r
+ }\r
+ }\r
\r
?>\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
- <title><?php echo _TITLE; ?></title>\r
- <style>@import url('nucleus/styles/manual.css');</style>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+ <title><?php echo _TITLE; ?></title>\r
+ <style>@import url('nucleus/styles/manual.css');</style>\r
</head>\r
<body>\r
- <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
+ <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
\r
<?php\r
- $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
-\r
- if (count($aAllErrors) > 0) {\r
- echo '<h1>' . _TITLE2 . '</h1>';\r
- echo '<ul><li>' . implode('</li><li>', $aAllErrors) . '</li></ul>';\r
- }\r
-\r
- if (!$bConfigWritten) { ?>\r
- <h1><?php echo _TITLE3; ?></h1>\r
-\r
- <? echo _TEXT10; ?>\r
-\r
- <pre><code><?php\r
- // mySQL connection information\r
- $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';\r
- $MYSQL_USER = '<b><?php echo $mysql_user?></b>';\r
- $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
- $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
- $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
-\r
- // main nucleus directory\r
- $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
-\r
- // path to media dir\r
- $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';\r
-\r
- // extra skin files for imported skins\r
- $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';\r
-\r
- // these dirs are normally sub dirs of the nucleus dir, but\r
- // you can redefine them if you wish\r
- $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
- $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
- $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
-\r
- // include libs\r
- include($DIR_LIBS . 'globalfunctions.php');\r
- if (!extension_loaded('mbstring')) {\r
- include($DIR_LIBS . 'mb_emulator/mb-emulator.php');\r
- }\r
+ $aAllErrors = array_merge($aSkinErrors, $aPlugErrors);\r
+\r
+ if (count($aAllErrors) > 0) {\r
+ echo '<h1>' . _TITLE2 . '</h1>';\r
+ echo '<ul><li>' . implode('</li><li>', $aAllErrors) . '</li></ul>';\r
+ }\r
+\r
+ if (!$bConfigWritten) { ?>\r
+ <h1><?php echo _TITLE3; ?></h1>\r
+\r
+ <? echo _TEXT10; ?>\r
+\r
+ <pre><code><?php\r
+ // mySQL connection information\r
+ $MYSQL_HOST = '<b><?php echo $mysql_host?></b>';\r
+ $MYSQL_USER = '<b><?php echo $mysql_user?></b>';\r
+ $MYSQL_PASSWORD = '<i><b>xxxxxxxxxxx</b></i>';\r
+ $MYSQL_DATABASE = '<b><?php echo $mysql_database?></b>';\r
+ $MYSQL_PREFIX = '<b><?php echo ($mysql_usePrefix == 1)?$mysql_prefix:''?></b>';\r
+\r
+ // main nucleus directory\r
+ $DIR_NUCLEUS = '<b><?php echo $config_adminpath?></b>';\r
+\r
+ // path to media dir\r
+ $DIR_MEDIA = '<b><?php echo $config_mediapath?></b>';\r
+\r
+ // extra skin files for imported skins\r
+ $DIR_SKINS = '<b><?php echo $config_skinspath?></b>';\r
+\r
+ // these dirs are normally sub dirs of the nucleus dir, but\r
+ // you can redefine them if you wish\r
+ $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';\r
+ $DIR_LANG = $DIR_NUCLEUS . 'language/';\r
+ $DIR_LIBS = $DIR_NUCLEUS . 'libs/';\r
+\r
+ // include libs\r
+ include($DIR_LIBS . 'globalfunctions.php');\r
+ if (!extension_loaded('mbstring')) {\r
+ include($DIR_LIBS . 'mb_emulator/mb-emulator.php');\r
+ }\r
?></code></pre>\r
\r
- <?php echo _TEXT11; ?>\r
+ <?php echo _TEXT11; ?>\r
\r
- <div class="note">\r
- <?php echo _TEXT12; ?>\r
- </div>\r
+ <div class="note">\r
+ <?php echo _TEXT12; ?>\r
+ </div>\r
\r
<?php } else { ?>\r
\r
- <h1><?php echo _TITLE4; ?></h1>\r
+ <h1><?php echo _TITLE4; ?></h1>\r
\r
- <?php echo _TEXT13; ?>\r
+ <?php echo _TEXT13; ?>\r
\r
<?php } ?>\r
\r
- <h1><?php echo _TITLE5; ?></h1>\r
- \r
- <?php echo _TEXT14; ?>\r
+ <h1><?php echo _TITLE5; ?></h1>\r
+ \r
+ <?php echo _TEXT14; ?>\r
\r
- <ul>\r
- <li><?php echo _TEXT14_L1; ?></li>\r
- <li><?php echo _TEXT14_L2; ?></li>\r
- </ul>\r
+ <ul>\r
+ <li><?php echo _TEXT14_L1; ?></li>\r
+ <li><?php echo _TEXT14_L2; ?></li>\r
+ </ul>\r
\r
- <h1><?php echo _HEADER10; ?></h1>\r
+ <h1><?php echo _HEADER10; ?></h1>\r
\r
- <?php echo _TEXT15; ?>\r
+ <?php echo _TEXT15; ?>\r
\r
- <ul>\r
- <li><?php echo _TEXT15_L1; ?></li>\r
- <li><?php echo _TEXT15_L2; ?></li>\r
- <li><?php echo _TEXT15_L3; ?></li>\r
- </ul>\r
+ <ul>\r
+ <li><?php echo _TEXT15_L1; ?></li>\r
+ <li><?php echo _TEXT15_L2; ?></li>\r
+ <li><?php echo _TEXT15_L3; ?></li>\r
+ </ul>\r
\r
- <?php echo _TEXT16; ?>\r
+ <?php echo _TEXT16; ?>\r
\r
- <h1><?php echo _HEADER11; ?></h1>\r
+ <h1><?php echo _HEADER11; ?></h1>\r
\r
- <p><?php echo _TEXT16_H; ?>\r
- <ul>\r
- <li><a href="<?php echo $config_adminurl?>"><?php echo _TEXT16_L1; ?></a></li>\r
- <li><a href="<?php echo $config_indexurl?>"><?php echo _TEXT16_L2; ?></a></li>\r
- </ul>\r
- </p>\r
+ <p><?php echo _TEXT16_H; ?>\r
+ <ul>\r
+ <li><a href="<?php echo $config_adminurl?>"><?php echo _TEXT16_L1; ?></a></li>\r
+ <li><a href="<?php echo $config_indexurl?>"><?php echo _TEXT16_L2; ?></a></li>\r
+ </ul>\r
+ </p>\r
\r
</body>\r
</html>\r
}\r
\r
function installCustomPlugs(&$manager) {\r
- global $aConfPlugsToInstall, $DIR_LIBS;\r
+ global $aConfPlugsToInstall, $DIR_LIBS;\r
\r
- $aErrors = array();\r
+ $aErrors = array();\r
\r
- if (count($aConfPlugsToInstall) == 0) {\r
- return $aErrors;\r
- }\r
+ if (count($aConfPlugsToInstall) == 0) {\r
+ return $aErrors;\r
+ }\r
\r
- $res = sql_query('SELECT * FROM ' . sql_table('plugin') );\r
- $numCurrent = sql_num_rows($res);\r
+ $res = sql_query('SELECT * FROM ' . sql_table('plugin') );\r
+ $numCurrent = sql_num_rows($res);\r
\r
- foreach ($aConfPlugsToInstall as $plugName) {\r
- // do this before calling getPlugin (in case the plugin id is used there)\r
- $query = 'INSERT INTO ' . sql_table('plugin') . ' (porder, pfile) VALUES (' . (++$numCurrent) . ', "' . addslashes($plugName) . '")';\r
- sql_query($query);\r
+ foreach ($aConfPlugsToInstall as $plugName) {\r
+ // do this before calling getPlugin (in case the plugin id is used there)\r
+ $query = 'INSERT INTO ' . sql_table('plugin') . ' (porder, pfile) VALUES (' . (++$numCurrent) . ', "' . addslashes($plugName) . '")';\r
+ sql_query($query);\r
\r
- // get and install the plugin\r
- $manager->clearCachedInfo('installedPlugins');\r
- $plugin =& $manager->getPlugin($plugName);\r
- $plugin->plugid = $numCurrent;\r
+ // get and install the plugin\r
+ $manager->clearCachedInfo('installedPlugins');\r
+ $plugin =& $manager->getPlugin($plugName);\r
+ $plugin->plugid = $numCurrent;\r
\r
- if (!$plugin) {\r
- sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\'' . addslashes($plugName) . '\'');\r
- $numCurrent--;\r
- array_push($aErrors, _ERROR22 . $plugName);\r
- continue;\r
- }\r
+ if (!$plugin) {\r
+ sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE pfile=\'' . addslashes($plugName) . '\'');\r
+ $numCurrent--;\r
+ array_push($aErrors, _ERROR22 . $plugName);\r
+ continue;\r
+ }\r
\r
- $plugin->install();\r
- }\r
+ $plugin->install();\r
+ }\r
\r
- // SYNC PLUGIN EVENT LIST\r
- sql_query('DELETE FROM ' . sql_table('plugin_event') );\r
+ // SYNC PLUGIN EVENT LIST\r
+ sql_query('DELETE FROM ' . sql_table('plugin_event') );\r
\r
- // loop over all installed plugins\r
- $res = sql_query('SELECT pid, pfile FROM ' . sql_table('plugin') );\r
+ // loop over all installed plugins\r
+ $res = sql_query('SELECT pid, pfile FROM ' . sql_table('plugin') );\r
\r
- while($o = sql_fetch_object($res) ) {\r
- $pid = $o->pid;\r
- $plug =& $manager->getPlugin($o->pfile);\r
+ while($o = sql_fetch_object($res) ) {\r
+ $pid = $o->pid;\r
+ $plug =& $manager->getPlugin($o->pfile);\r
\r
- if ($plug) {\r
- $eventList = $plug->getEventList();\r
+ if ($plug) {\r
+ $eventList = $plug->getEventList();\r
\r
- foreach ($eventList as $eventName) {\r
- sql_query('INSERT INTO ' . sql_table('plugin_event') . ' (pid, event) VALUES (' . $pid . ', \'' . $eventName . '\')');\r
- }\r
- }\r
- }\r
+ foreach ($eventList as $eventName) {\r
+ sql_query('INSERT INTO ' . sql_table('plugin_event') . ' (pid, event) VALUES (' . $pid . ', \'' . $eventName . '\')');\r
+ }\r
+ }\r
+ }\r
\r
- return $aErrors;\r
+ return $aErrors;\r
}\r
\r
-function installCustomSkins(&$manager) {\r
- global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS;\r
+//function installCustomSkins(&$manager) {\r
+function installCustomSkins(&$mngr) {\r
+ global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS, $manager;\r
+ $manager = new MANAGER;\r
+ $aErrors = array();\r
\r
- $aErrors = array();\r
+ if (count($aConfSkinsToImport) == 0) {\r
+ return $aErrors;\r
+ }\r
\r
- if (count($aConfSkinsToImport) == 0) {\r
- return $aErrors;\r
- }\r
+ // load skinie class\r
+ include_once($DIR_LIBS . 'skinie.php');\r
\r
- // load skinie class\r
- include_once($DIR_LIBS . 'skinie.php');\r
+ $importer = new SKINIMPORT();\r
\r
- $importer = new SKINIMPORT();\r
+ foreach ($aConfSkinsToImport as $skinName) {\r
+ $importer->reset();\r
+ $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
\r
- foreach ($aConfSkinsToImport as $skinName) {\r
- $importer->reset();\r
- $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';\r
+ if (!@file_exists($skinFile) ) {\r
+ array_push($aErrors, _ERROR23_1 . $skinFile . ' : ' . _ERROR23_2);\r
+ continue;\r
+ }\r
\r
- if (!@file_exists($skinFile) ) {\r
- array_push($aErrors, _ERROR23_1 . $skinFile . ' : ' . _ERROR23_2);\r
- continue;\r
- }\r
+ $error = $importer->readFile($skinFile);\r
\r
- $error = $importer->readFile($skinFile);\r
+ if ($error) {\r
+ array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
+ continue;\r
+ }\r
\r
- if ($error) {\r
- array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
- continue;\r
- }\r
+ $error = $importer->writeToDatabase(1);\r
\r
- $error = $importer->writeToDatabase(1);\r
+ if ($error) {\r
+ array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
+ continue;\r
+ }\r
+ }\r
\r
- if ($error) {\r
- array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);\r
- continue;\r
- }\r
- }\r
-\r
- return $aErrors;\r
+ return $aErrors;\r
}\r
\r
// give an error if one or more nucleus are not accessible\r
function doCheckFiles() {\r
- $missingfiles = array();\r
- $files = array(\r
- 'install.sql',\r
- 'index.php',\r
- 'action.php',\r
- 'nucleus/index.php',\r
- 'nucleus/libs/globalfunctions.php',\r
- 'nucleus/libs/ADMIN.php',\r
- 'nucleus/libs/BLOG.php',\r
- 'nucleus/libs/COMMENT.php',\r
- 'nucleus/libs/COMMENTS.php',\r
- 'nucleus/libs/ITEM.php',\r
- 'nucleus/libs/MEMBER.php',\r
- 'nucleus/libs/SKIN.php',\r
- 'nucleus/libs/TEMPLATE.php',\r
- 'nucleus/libs/MEDIA.php',\r
- 'nucleus/libs/ACTIONLOG.php',\r
- 'nucleus/media.php'\r
- );\r
-\r
- $count = count($files);\r
-\r
- for ($i = 0; $i < $count; $i++) {\r
- if (!is_readable($files[$i]) ) {\r
- array_push($missingfiles, _ERROR25_1 . $files[$i] . _ERROR25_2);\r
- }\r
- }\r
+ $missingfiles = array();\r
+ $files = array(\r
+ 'install.sql',\r
+ 'index.php',\r
+ 'action.php',\r
+ 'nucleus/index.php',\r
+ 'nucleus/libs/globalfunctions.php',\r
+ 'nucleus/libs/ADMIN.php',\r
+ 'nucleus/libs/BLOG.php',\r
+ 'nucleus/libs/COMMENT.php',\r
+ 'nucleus/libs/COMMENTS.php',\r
+ 'nucleus/libs/ITEM.php',\r
+ 'nucleus/libs/MEMBER.php',\r
+ 'nucleus/libs/SKIN.php',\r
+ 'nucleus/libs/TEMPLATE.php',\r
+ 'nucleus/libs/MEDIA.php',\r
+ 'nucleus/libs/ACTIONLOG.php',\r
+ 'nucleus/media.php'\r
+ );\r
+\r
+ $count = count($files);\r
+\r
+ for ($i = 0; $i < $count; $i++) {\r
+ if (!is_readable($files[$i]) ) {\r
+ array_push($missingfiles, _ERROR25_1 . $files[$i] . _ERROR25_2);\r
+ }\r
+ }\r
\r
// The above code replaces several if statements of the form:\r
\r
// array_push($missingfiles, 'File <b>install.sql</b> is missing or not readable');\r
// }\r
\r
- if (count($missingfiles) > 0) {\r
- showErrorMessages($missingfiles);\r
- }\r
+ if (count($missingfiles) > 0) {\r
+ showErrorMessages($missingfiles);\r
+ }\r
}\r
\r
function updateConfig($name, $val) {\r
- global $MYSQL_CONN;\r
- $name = addslashes($name);\r
- $val = trim(addslashes($val) );\r
+ global $MYSQL_CONN;\r
+ $name = addslashes($name);\r
+ $val = trim(addslashes($val) );\r
\r
- $query = 'UPDATE ' . tableName('nucleus_config')\r
- . " SET value = '$val'"\r
- . " WHERE name = '$name'";\r
+ $query = 'UPDATE ' . tableName('nucleus_config')\r
+ . " SET value = '$val'"\r
+ . " WHERE name = '$name'";\r
\r
- sql_query($query,$MYSQL_CONN) or _doError(_ERROR26 . ': ' . mysql_error($MYSQL_CONN) );\r
- return sql_insert_id($MYSQL_CONN);\r
+ sql_query($query,$MYSQL_CONN) or _doError(_ERROR26 . ': ' . mysql_error($MYSQL_CONN) );\r
+ return sql_insert_id($MYSQL_CONN);\r
}\r
\r
function replaceDoubleBackslash($input) {\r
- return str_replace('\\', '/', $input);\r
+ return str_replace('\\', '/', $input);\r
}\r
\r
function endsWithSlash($s) {\r
- return (strrpos($s, '/') == strlen($s) - 1);\r
+ return (strrpos($s, '/') == strlen($s) - 1);\r
}\r
\r
/**\r
* Checks if email address is valid\r
*/\r
function _isValidMailAddress($address) {\r
- if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
- return 1;\r
- } else {\r
- return 0;\r
- }\r
+ if (preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) ) {\r
+ return 1;\r
+ } else {\r
+ return 0;\r
+ }\r
}\r
\r
// returns true if the given string is a valid shortname\r
// logic: starts and ends with a non space, can contain spaces in between\r
// min 2 chars\r
function _isValidShortName($name) {\r
- if (eregi("^[a-z0-9]+$", $name) ) {\r
- return 1;\r
- } else {\r
- return 0;\r
- }\r
+ if (eregi("^[a-z0-9]+$", $name) ) {\r
+ return 1;\r
+ } else {\r
+ return 0;\r
+ }\r
}\r
\r
\r
// returns true if the given string is a valid display name\r
// (to check nicknames)\r
function _isValidDisplayName($name) {\r
- if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
- return 1;\r
- } else {\r
- return 0;\r
- }\r
+ if (eregi("^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$", $name) ) {\r
+ return 1;\r
+ } else {\r
+ return 0;\r
+ }\r
}\r
\r
function _doError($msg) {\r
- ?>\r
+ ?>\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
- <title><?php echo _TITLE; ?></title>\r
- <style>@import url('nucleus/styles/manual.css');</style>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+ <title><?php echo _TITLE; ?></title>\r
+ <style>@import url('nucleus/styles/manual.css');</style>\r
</head>\r
<body>\r
- <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
- <h1><?php echo _ERROR27; ?></h1>\r
+ <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
+ <h1><?php echo _ERROR27; ?></h1>\r
\r
- <p><?php echo _ERROR28; ?> "<?php echo $msg; ?>";</p>\r
+ <p><?php echo _ERROR28; ?> "<?php echo $msg; ?>";</p>\r
\r
- <p><a href="install.php" onclick="history.back();"><?php echo _TEXT17; ?></a></p>\r
+ <p><a href="install.php" onclick="history.back();"><?php echo _TEXT17; ?></a></p>\r
</body>\r
</html>\r
\r
<?php\r
- exit;\r
+ exit;\r
}\r
\r
function showErrorMessages($errors) {\r
- ?>\r
+ ?>\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
- <title><?php echo _TITLE; ?></title>\r
- <style>@import url('nucleus/styles/manual.css');</style>\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+ <title><?php echo _TITLE; ?></title>\r
+ <style>@import url('nucleus/styles/manual.css');</style>\r
</head>\r
<body>\r
- <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
- <h1><?php echo _ERROR27; ?></h1>\r
+ <div style='text-align:center'><img src='./nucleus/styles/logo.gif' /></div> <!-- Nucleus logo -->\r
+ <h1><?php echo _ERROR27; ?></h1>\r
\r
- <p><?php echo _ERROR29; ?>:</p>\r
+ <p><?php echo _ERROR29; ?>:</p>\r
\r
- <ul>\r
+ <ul>\r
\r
<?php\r
- while($msg = array_shift($errors) ) {\r
- echo '<li>' . $msg . '</li>';\r
- }\r
+ while($msg = array_shift($errors) ) {\r
+ echo '<li>' . $msg . '</li>';\r
+ }\r
?>\r
\r
- </ul>\r
+ </ul>\r
\r
- <p><a href="install.php" onclick="history.back();return false;"><?php echo _TEXT17; ?></a></p>\r
+ <p><a href="install.php" onclick="history.back();return false;"><?php echo _TEXT17; ?></a></p>\r
</body>\r
</html>\r
\r
<?php\r
- exit;\r
+ exit;\r
}\r
\r
/* for the non-php systems that decide to show the contents:\r
`iprange` varchar(15) NOT NULL default '',
`reason` varchar(255) NOT NULL default '',
`blogid` int(11) NOT NULL default '0'
--- KEY `iprange` (`iprange`),
--- KEY `blogid` (`blogid`)
) TYPE=MyISAM;
CREATE TABLE `nucleus_blog` (
`bupdate` varchar(60) default NULL,
`bdefskin` int(11) NOT NULL default '1',
`bpublic` tinyint(2) NOT NULL default '1',
--- `bsendping` tinyint(2) NOT NULL default '0',
`bconvertbreaks` tinyint(2) NOT NULL default '1',
`bdefcat` int(11) default NULL,
`bnotifytype` int(11) NOT NULL default '15',
`breqemail` tinyint(2) NOT NULL default '0',
`bfuturepost` tinyint(2) NOT NULL default '0',
PRIMARY KEY (`bnumber`),
--- UNIQUE KEY `bnumber` (`bnumber`),
UNIQUE KEY `bshortname` (`bshortname`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 0, 1, 1, 1, 1, 0, 0, 0);
+INSERT INTO `nucleus_blog` VALUES (
+ 1, /* bnumber */
+ 'My Nucleus CMS', /* bname */
+ 'mynucleuscms', /* bshortname */
+ '', /* bdesc */
+ 1, /* bcomments */
+ 0, /* bmaxcomments */
+ 0.0, /* btimeoffset */
+ '', /* bnotify */
+ 'http://localhost:8080/nucleus/', /* burl */
+ '', /* bupdate */
+ 5, /* bdefskin */
+ 1, /* bpublic */
+ 1, /* bconvertbreaks */
+ 1, /* bdefcat */
+ 1, /* bnotifytype */
+ 1, /* ballowpast */
+ 0, /* bincludesearch */
+ 0, /* breqemail */
+ 0 /* bfuturepost */
+);
CREATE TABLE `nucleus_category` (
`catid` int(11) NOT NULL auto_increment,
`cip` varchar(15) NOT NULL default '',
`cblog` int(11) NOT NULL default '0',
PRIMARY KEY (`cnumber`),
--- UNIQUE KEY `cnumber` (`cnumber`),
KEY `citem` (`citem`),
FULLTEXT KEY `cbody` (`cbody`)
) TYPE=MyISAM;
PRIMARY KEY (`name`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_config` VALUES ('DefaultBlog', '1');
-INSERT INTO `nucleus_config` VALUES ('AdminEmail', 'example@example.org');
-INSERT INTO `nucleus_config` VALUES ('IndexURL', 'http://localhost:8080/nucleus/');
-INSERT INTO `nucleus_config` VALUES ('Language', 'japanese-utf8');
-INSERT INTO `nucleus_config` VALUES ('SessionCookie', '');
-INSERT INTO `nucleus_config` VALUES ('AllowMemberCreate', '');
-INSERT INTO `nucleus_config` VALUES ('AllowMemberMail', '1');
-INSERT INTO `nucleus_config` VALUES ('SiteName', 'My Nucleus CMS');
-INSERT INTO `nucleus_config` VALUES ('AdminURL', 'http://localhost:8080/nucleus/nucleus/');
-INSERT INTO `nucleus_config` VALUES ('NewMemberCanLogon', '1');
-INSERT INTO `nucleus_config` VALUES ('DisableSite', '');
-INSERT INTO `nucleus_config` VALUES ('DisableSiteURL', 'http://www.this-page-intentionally-left-blank.org/');
-INSERT INTO `nucleus_config` VALUES ('LastVisit', '');
-INSERT INTO `nucleus_config` VALUES ('MediaURL', 'http://localhost:8080/nucleus/media/');
-INSERT INTO `nucleus_config` VALUES ('AllowedTypes', 'jpg,jpeg,gif,mpg,mpeg,avi,mov,mp3,swf,png');
-INSERT INTO `nucleus_config` VALUES ('AllowLoginEdit', '');
-INSERT INTO `nucleus_config` VALUES ('AllowUpload', '1');
-INSERT INTO `nucleus_config` VALUES ('DisableJsTools', '2');
-INSERT INTO `nucleus_config` VALUES ('CookiePath', '/');
-INSERT INTO `nucleus_config` VALUES ('CookieDomain', '');
-INSERT INTO `nucleus_config` VALUES ('CookieSecure', '');
-INSERT INTO `nucleus_config` VALUES ('CookiePrefix', '');
-INSERT INTO `nucleus_config` VALUES ('MediaPrefix', '1');
-INSERT INTO `nucleus_config` VALUES ('MaxUploadSize', '1048576');
-INSERT INTO `nucleus_config` VALUES ('NonmemberMail', '');
-INSERT INTO `nucleus_config` VALUES ('PluginURL', 'http://localhost:8080/nucleus/nucleus/plugins/');
-INSERT INTO `nucleus_config` VALUES ('ProtectMemNames', '1');
-INSERT INTO `nucleus_config` VALUES ('BaseSkin', '5');
-INSERT INTO `nucleus_config` VALUES ('SkinsURL', 'http://localhost:8080/nucleus/skins/');
-INSERT INTO `nucleus_config` VALUES ('ActionURL', 'http://localhost:8080/nucleus/action.php');
-INSERT INTO `nucleus_config` VALUES ('URLMode', 'normal');
-INSERT INTO `nucleus_config` VALUES ('DatabaseVersion', '340');
-INSERT INTO `nucleus_config` VALUES ('DebugVars', '0');
-INSERT INTO `nucleus_config` VALUES ('DefaultListSize', '10');
+INSERT INTO `nucleus_config` (`name`, `value`) VALUES
+ ('DefaultBlog', '1'),
+ ('AdminEmail', 'example@example.org'),
+ ('IndexURL', 'http://localhost:8080/nucleus/'),
+ ('Language', 'japanese-utf8'),
+ ('SessionCookie', ''),
+ ('AllowMemberCreate', ''),
+ ('AllowMemberMail', '1'),
+ ('SiteName', 'My Nucleus CMS'),
+ ('AdminURL', 'http://localhost:8080/nucleus/nucleus/'),
+ ('NewMemberCanLogon', '1'),
+ ('DisableSite', ''),
+ ('DisableSiteURL', 'http://www.this-page-intentionally-left-blank.org/'),
+ ('LastVisit', ''),
+ ('MediaURL', 'http://localhost:8080/nucleus/media/'),
+ ('AllowedTypes', 'jpg,jpeg,gif,mpg,mpeg,avi,mov,mp3,swf,png'),
+ ('AllowLoginEdit', ''),
+ ('AllowUpload', '1'),
+ ('DisableJsTools', '2'),
+ ('CookiePath', '/'),
+ ('CookieDomain', ''),
+ ('CookieSecure', ''),
+ ('CookiePrefix', ''),
+ ('MediaPrefix', '1'),
+ ('MaxUploadSize', '1048576'),
+ ('NonmemberMail', ''),
+ ('PluginURL', 'http://localhost:8080/nucleus/nucleus/plugins/'),
+ ('ProtectMemNames', '1'),
+ ('BaseSkin', '5'),
+ ('SkinsURL', 'http://localhost:8080/nucleus/skins/'),
+ ('ActionURL', 'http://localhost:8080/nucleus/action.php'),
+ ('URLMode', 'normal'),
+ ('DatabaseVersion', '340'),
+ ('DebugVars', '0'),
+ ('DefaultListSize', '10');
CREATE TABLE `nucleus_item` (
`inumber` int(11) NOT NULL auto_increment,
`ikarmaneg` int(11) NOT NULL default '0',
`iposted` tinyint(2) NOT NULL default '1',
PRIMARY KEY (`inumber`),
--- UNIQUE KEY `inumber` (`inumber`),
KEY `itime` (`itime`),
FULLTEXT KEY `ibody` (`ibody`, `ititle`, `imore`)
) TYPE=MyISAM PACK_KEYS=0;
CREATE TABLE `nucleus_karma` (
`itemid` int(11) NOT NULL default '0',
`ip` char(15) NOT NULL default ''
---, KEY `itemid` (`itemid`)
) TYPE=MyISAM;
CREATE TABLE `nucleus_member` (
`deflang` varchar(20) NOT NULL default '',
`mautosave` tinyint(2) NOT NULL default '1',
PRIMARY KEY (`mnumber`),
--- UNIQUE KEY `mnumber` (`mnumber`),
UNIQUE KEY `mname` (`mname`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_member` VALUES (1, 'example', 'example', '1a79a4d60de6718e8e5b326e338ae533', 'example@example.org', 'http://localhost:8080/nucleus/', '', 1, 1, 'd767aefc60415859570d64c649257f19', '', 1);
+INSERT INTO `nucleus_member` VALUES (
+ 1, /* mnumber */
+ 'example', /* mname */
+ 'example', /* mrealname */
+ '1a79a4d60de6718e8e5b326e338ae533', /* mpassword */
+ 'example@example.org', /* memail */
+ 'http://localhost:8080/nucleus/', /* murl */
+ '', /* mnotes */
+ 1, /* madmin */
+ 1, /* mcanlogin */
+ 'd767aefc60415859570d64c649257f19', /* mcookiekey */
+ '', /* deflang */
+ 1 /* mautosave */
+);
CREATE TABLE `nucleus_plugin` (
`pid` int(11) NOT NULL auto_increment,
`pfile` varchar(40) NOT NULL default '',
`porder` int(11) NOT NULL default '0',
PRIMARY KEY (`pid`),
--- KEY `pid` (`pid`),
KEY `porder` (`porder`)
) TYPE=MyISAM;
PRIMARY KEY (`sdesc`,`stype`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_skin` VALUES (2, 'index', '<?xml version="1.0" encoding="UTF-8"?>\n\n<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom\">\n <title><%blogsetting(name)%></title>\n <subtitle><%blogsetting(desc)%></subtitle>\n <id><%blogsetting(url)%>:<%blogsetting(id)%></id>\n\n <link rel="alternate" type="text/html" href="<%blogsetting(url)%>" />\n <link rel="self" type="application/atom+xml" href="<%blogsetting(url)%><%self%>" />\n <generator uri="http://nucleuscms.org/"><%version%></generator>\n <updated><%blog(feeds/atom/modified,1)%></updated>\n\n <%blog(feeds/atom/entries,10)%>\n</feed>');
-INSERT INTO `nucleus_skin` VALUES (4, 'index', '<?xml version="1.0"?>\r\n<rsd version="1.0">\r\n <service>\r\n <engineName><%version%></engineName>\r\n <engineLink>http://nucleuscms.org/</engineLink>\r\n <homepageLink><%sitevar(url)%></homepageLink>\r\n <apis>\r\n <api name="MetaWeblog" preferred="true" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">\r\n <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>\r\n </api>\r\n <api name="Blogger" preferred="false" apiLink="<%adminurl%>xmlrpc/server.php" blogID="<%blogsetting(id)%>">\r\n <docs>http://nucleuscms.org/documentation/devdocs/xmlrpc.html</docs>\r\n </api>\r\n </apis>\r\n </service>\r\n</rsd>');
-INSERT INTO `nucleus_skin` VALUES (3, 'index', '<?xml version="1.0" encoding="UTF-8"?>\r\n<rss version="2.0">\r\n <channel>\r\n <title><%blogsetting(name)%></title>\r\n <link><%blogsetting(url)%></link>\r\n <description><%blogsetting(desc)%></description>\r\n <language>ja</language>\r\n <generator><%version%></generator>\r\n <copyright>©</copyright>\r\n <category>Weblog</category>\r\n <docs>http://backend.userland.com/rss</docs>\r\n <image>\r\n <url><%adminurl%>nucleus2.gif</url>\r\n <title><%blogsetting(name)%></title>\r\n <link><%blogsetting(url)%></link>\r\n </image>\r\n <%blog(feeds/rss20,10)%>\r\n </channel>\r\n</rss>');
-
CREATE TABLE `nucleus_skin_desc` (
`sdnumber` int(11) NOT NULL auto_increment,
`sdname` varchar(20) NOT NULL default '',
`sdincmode` varchar(10) NOT NULL default 'normal',
`sdincpref` varchar(50) NOT NULL default '',
PRIMARY KEY (`sdnumber`),
--- UNIQUE KEY `sdnumber` (`sdnumber`),
UNIQUE KEY `sdname` (`sdname`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_skin_desc` VALUES (2, 'feeds/atom', 'Atom 1.0 weblog syndication', 'application/atom+xml', 'normal', '');
-INSERT INTO `nucleus_skin_desc` VALUES (3, 'feeds/rss20', 'RSS 2.0 syndication of weblogs', 'text/xml', 'normal', '');
-INSERT INTO `nucleus_skin_desc` VALUES (4, 'xml/rsd', 'RSD (Really Simple Discovery) information for weblog clients', 'text/xml', 'normal', '');
-INSERT INTO `nucleus_skin_desc` VALUES (5, 'default', 'Nucleus CMS default skin', 'text/html', 'skindir', 'default/');
-
CREATE TABLE `nucleus_team` (
`tmember` int(11) NOT NULL default '0',
`tblog` int(11) NOT NULL default '0',
PRIMARY KEY (`tdesc`, `tpartname`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_template` VALUES (3, 'ITEM', '<item>\r\n <title><%title(xml)%></title>\r\n <link><%blogurl%>?itemid=<%itemid%></link>\r\n<description><![CDATA[<%body%><%more%>]]></description>\r\n <category><%category%></category>\r\n<comments><%blogurl%>?itemid=<%itemid%></comments>\r\n <pubDate><%date(rfc822)%></pubDate>\r\n</item>');
-INSERT INTO `nucleus_template` VALUES (3, 'EDITLINK', '<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>');
-INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_DATE', '%Y-%m-%d');
-INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_TIME', '%H:%M:%S');
-INSERT INTO `nucleus_template` VALUES (4, 'ITEM', '<%date(utc)%>');
-INSERT INTO `nucleus_template` VALUES (5, 'ITEM', '<entry>\r\n <title type="html"><![CDATA[<%title%>]]></title>\r\n <link rel="alternate" type="text/html" href="<%blogurl%>?itemid=<%itemid%>" />\r\n <author>\r\n <name><%author%></name>\r\n </author>\r\n <updated><%date(utc)%></updated>\r\n <published><%date(iso8601)%></published>\r\n <content type="html"><![CDATA[<%body%><%more%>]]></content>\r\n <id><%blogurl%>:<%blogid%>:<%itemid%></id>\r\n</entry>');
-INSERT INTO `nucleus_template` VALUES (5, 'POPUP_CODE', '<%media%>');
-INSERT INTO `nucleus_template` VALUES (5, 'IMAGE_CODE', '<%image%>');
-INSERT INTO `nucleus_template` VALUES (5, 'MEDIA_CODE', '<%media%>');
-INSERT INTO `nucleus_template` VALUES (3, 'POPUP_CODE', '<%image%>');
-INSERT INTO `nucleus_template` VALUES (3, 'MEDIA_CODE', '<%media%>');
-INSERT INTO `nucleus_template` VALUES (3, 'IMAGE_CODE', '<%media%>');
-
CREATE TABLE `nucleus_template_desc` (
`tdnumber` int(11) NOT NULL auto_increment,
`tdname` varchar(64) NOT NULL default '',
`tddesc` varchar(200) default NULL,
PRIMARY KEY (`tdnumber`),
--- UNIQUE KEY `tdnumber` (`tdnumber`),
UNIQUE KEY `tdname` (`tdname`)
) TYPE=MyISAM;
-INSERT INTO `nucleus_template_desc` VALUES (4, 'feeds/atom/modified', 'Atom feeds: Inserts last modification date');
-INSERT INTO `nucleus_template_desc` VALUES (5, 'feeds/atom/entries', 'Atom feeds: Feed items');
-INSERT INTO `nucleus_template_desc` VALUES (3, 'feeds/rss20', 'Used for RSS 2.0 syndication of your blog');
-INSERT INTO `nucleus_template_desc` VALUES (8, 'default/index', 'Nucleus CMS default index template');
-INSERT INTO `nucleus_template_desc` VALUES (9, 'default/item', 'Nucleus CMS default item template');
-
CREATE TABLE `nucleus_tickets` (
`ticket` varchar(40) NOT NULL default '',
`ctime` datetime NOT NULL default '0000-00-00 00:00:00',
*/
class NP_SecurityEnforcer extends NucleusPlugin {
- function getName() { return 'SecurityEnforcer'; }
+ function getName() { return 'SecurityEnforcer'; }
- function getAuthor() { return 'Frank Truscott'; }
+ function getAuthor() { return 'Frank Truscott'; }
- function getURL() { return 'http://revcetera.com/ftruscot'; }
+ function getURL() { return 'http://revcetera.com/ftruscot'; }
- function getVersion() { return '1.0'; }
+ function getVersion() { return '1.0'; }
- function getDescription() {
- return _SECURITYENFORCER_DESCRIPTION;
- }
-
- function getMinNucleusVersion() { return 350; }
+ function getDescription() {
+ return _SECURITYENFORCER_DESCRIPTION;
+ }
+
+ function getMinNucleusVersion() { return 350; }
- function supportsFeature($what) {
- switch($what) {
- case 'SqlTablePrefix':
- return 1;
- /*case 'HelpPage':
- return 1;*/
- default:
- return 0;
- }
- }
+ function supportsFeature($what) {
+ switch($what) {
+ case 'SqlTablePrefix':
+ return 1;
+ /*case 'HelpPage':
+ return 1;*/
+ default:
+ return 0;
+ }
+ }
- function getTableList() { return array(sql_table('plug_securityenforcer')); }
- function getEventList() { return array('QuickMenu','PrePasswordSet','CustomLogin','LoginSuccess','LoginFailed'); }
-
- function install() {
- global $CONF;
+ function getTableList() { return array(sql_table('plug_securityenforcer')); }
+ function getEventList() { return array('QuickMenu','PrePasswordSet','CustomLogin','LoginSuccess','LoginFailed'); }
+
+ function install() {
+ global $CONF;
// Need to make some options
- $this->createOption('quickmenu', _SECURITYENFORCER_OPT_QUICKMENU, 'yesno', 'yes');
- $this->createOption('del_uninstall_data', _SECURITYENFORCER_OPT_DEL_UNINSTALL_DATA, 'yesno','no');
- $this->createOption('enable_security', _SECURITYENFORCER_OPT_ENABLE, 'yesno','yes');
- $this->createOption('pwd_min_length', _SECURITYENFORCER_OPT_PWD_MIN_LENGTH, 'text','8');
- $this->createOption('pwd_complexity', _SECURITYENFORCER_OPT_PWD_COMPLEXITY, 'select','0',_SECURITYENFORCER_OPT_SELECT_OFF_COMP.'|0|'._SECURITYENFORCER_OPT_SELECT_ONE_COMP.'|1|'._SECURITYENFORCER_OPT_SELECT_TWO_COMP.'|2|'._SECURITYENFORCER_OPT_SELECT_THREE_COMP.'|3|'._SECURITYENFORCER_OPT_SELECT_FOUR_COMP.'|4');
- $this->createOption('max_failed_login', _SECURITYENFORCER_OPT_MAX_FAILED_LOGIN, 'text', '5');
- $this->createOption('login_lockout', _SECURITYENFORCER_OPT_LOGIN_LOCKOUT, 'text', '15');
-
+ $this->createOption('quickmenu', _SECURITYENFORCER_OPT_QUICKMENU, 'yesno', 'yes');
+ $this->createOption('del_uninstall_data', _SECURITYENFORCER_OPT_DEL_UNINSTALL_DATA, 'yesno','no');
+ $this->createOption('enable_security', _SECURITYENFORCER_OPT_ENABLE, 'yesno','yes');
+ $this->createOption('pwd_min_length', _SECURITYENFORCER_OPT_PWD_MIN_LENGTH, 'text','8');
+ $this->createOption('pwd_complexity', _SECURITYENFORCER_OPT_PWD_COMPLEXITY, 'select','0',_SECURITYENFORCER_OPT_SELECT_OFF_COMP.'|0|'._SECURITYENFORCER_OPT_SELECT_ONE_COMP.'|1|'._SECURITYENFORCER_OPT_SELECT_TWO_COMP.'|2|'._SECURITYENFORCER_OPT_SELECT_THREE_COMP.'|3|'._SECURITYENFORCER_OPT_SELECT_FOUR_COMP.'|4');
+ $this->createOption('max_failed_login', _SECURITYENFORCER_OPT_MAX_FAILED_LOGIN, 'text', '5');
+ $this->createOption('login_lockout', _SECURITYENFORCER_OPT_LOGIN_LOCKOUT, 'text', '15');
+
// create needed tables
- sql_query("CREATE TABLE IF NOT EXISTS ". sql_table('plug_securityenforcer').
- " (
- `login` varchar(255),
- `fails` int(11) NOT NULL default '0',
- `lastfail` bigint NOT NULL default '0',
- KEY `login` (`login`)) TYPE=MyISAM");
+ sql_query("CREATE TABLE IF NOT EXISTS ". sql_table('plug_securityenforcer').
+ " (
+ `login` varchar(255),
+ `fails` int(11) NOT NULL default '0',
+ `lastfail` bigint NOT NULL default '0',
+ KEY `login` (`login`)) TYPE=MyISAM");
- }
-
- function unInstall() {
- // if requested, delete the data table
- if ($this->getOption('del_uninstall_data') == 'yes') {
- sql_query('DROP TABLE '.sql_table('plug_securityenforcer'));
- }
- }
-
- function init() {
- // include language file for this plugin
+ }
+
+ function unInstall() {
+ // if requested, delete the data table
+ if ($this->getOption('del_uninstall_data') == 'yes') {
+ sql_query('DROP TABLE '.sql_table('plug_securityenforcer'));
+ }
+ }
+
+ function init() {
+ // include language file for this plugin
$language = ereg_replace( '[\\|/]', '', getLanguageName());
if (file_exists($this->getDirectory().$language.'.php'))
include_once($this->getDirectory().$language.'.php');
else
include_once($this->getDirectory().'english.php');
-
- $this->enable_security = $this->getOption('enable_security');
- $this->pwd_min_length = intval($this->getOption('pwd_min_length'));
- $this->pwd_complexity = intval($this->getOption('pwd_complexity'));
- $this->max_failed_login = intval($this->getOption('max_failed_login'));
- $this->login_lockout = intval($this->getOption('login_lockout'));
- }
- function hasAdminArea() { return 1; }
+
+ $this->enable_security = $this->getOption('enable_security');
+ $this->pwd_min_length = intval($this->getOption('pwd_min_length'));
+ $this->pwd_complexity = intval($this->getOption('pwd_complexity'));
+ $this->max_failed_login = intval($this->getOption('max_failed_login'));
+ $this->login_lockout = intval($this->getOption('login_lockout'));
+ }
+ function hasAdminArea() { return 1; }
- function event_QuickMenu(&$data) {
- // only show when option enabled
- global $member;
- if ($this->getOption('quickmenu') != 'yes' || !$member->isAdmin()) return;
- global $member;
- if (!($member->isLoggedIn())) return;
- array_push($data['options'],
- array('title' => 'Security Enforcer',
- 'url' => $this->getAdminURL(),
- 'tooltip' => _SECURITYENFORCER_ADMIN_TOOLTIP));
- }
-
- function event_PrePasswordSet(&$data) {
- //password, errormessage, valid
- if ($this->enable_security == 'yes') {
- if (!$this->_validate_passwd($data['password'],$this->pwd_min_length, $this->pwd_complexity)) {
- $data['errormessage'] = _SECURITYENFORCER_INSUFFICIENT_COMPLEXITY;
- $data['errormessage'] .= _SECURITYENFORCER_MIN_PWD_LENGTH . $this->pwd_min_length;
- $data['errormessage'] .= _SECURITYENFORCER_PWD_COMPLEXITY . $this->pwd_complexity . "<br /><br />\n";
- $data['valid'] = false;
- }
- }
- }
-
- function event_CustomLogin(&$data) {
- //login,password,success,allowlocal
- if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
- global $_SERVER;
- $login = $data['login'];
- $ip = $_SERVER['REMOTE_ADDR'];
- sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE lastfail < ".(time() - ($this->login_lockout * 60)));
- $query = "SELECT fails as result FROM ".sql_table('plug_securityenforcer')." ";
+ function event_QuickMenu($data) {
+ // only show when option enabled
+ global $member;
+ if ($this->getOption('quickmenu') != 'yes' || !$member->isAdmin()) return;
+ global $member;
+ if (!($member->isLoggedIn())) return;
+ array_push($data['options'],
+ array('title' => 'Security Enforcer',
+ 'url' => $this->getAdminURL(),
+ 'tooltip' => _SECURITYENFORCER_ADMIN_TOOLTIP));
+ }
+
+ function event_PrePasswordSet($data) {
+ //password, errormessage, valid
+ if ($this->enable_security == 'yes') {
+ if (!$this->_validate_passwd($data['password'],$this->pwd_min_length, $this->pwd_complexity)) {
+ $data['errormessage'] = _SECURITYENFORCER_INSUFFICIENT_COMPLEXITY;
+ $data['errormessage'] .= _SECURITYENFORCER_MIN_PWD_LENGTH . $this->pwd_min_length;
+ $data['errormessage'] .= _SECURITYENFORCER_PWD_COMPLEXITY . $this->pwd_complexity . "<br /><br />\n";
+ $data['valid'] = false;
+ }
+ }
+ }
+
+ function event_CustomLogin($data) {
+ //login,password,success,allowlocal
+ if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
+ global $_SERVER;
+ $login = $data['login'];
+ $ip = $_SERVER['REMOTE_ADDR'];
+ sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE lastfail < ".(time() - ($this->login_lockout * 60)));
+ $query = "SELECT fails as result FROM ".sql_table('plug_securityenforcer')." ";
// $query .= "WHERE login='".addslashes($login)."'";
- $query .= "WHERE login='".sql_real_escape_string($login)."'";
- $flogin = quickQuery($query);
- $query = "SELECT fails as result FROM ".sql_table('plug_securityenforcer')." ";
+ $query .= "WHERE login='".sql_real_escape_string($login)."'";
+ $flogin = quickQuery($query);
+ $query = "SELECT fails as result FROM ".sql_table('plug_securityenforcer')." ";
// $query .= "WHERE login='".addslashes($ip)."'";
- $query .= "WHERE login='".sql_real_escape_string($ip)."'";
- $fip = quickQuery($query);
- if ($flogin >= $this->max_failed_login || $fip >= $this->max_failed_login) {
- $data['success'] = 0;
- $data['allowlocal'] = 0;
+ $query .= "WHERE login='".sql_real_escape_string($ip)."'";
+ $fip = quickQuery($query);
+ if ($flogin >= $this->max_failed_login || $fip >= $this->max_failed_login) {
+ $data['success'] = 0;
+ $data['allowlocal'] = 0;
// ACTIONLOG::add(INFO, 'login disallowed by NP_SecurityEnforcer. login: '.htmlentities($login).', ip: '.htmlentities($ip) );
- $info = sprintf(_SECURITYENFORCER_LOGIN_DISALLOWED, htmlspecialchars($login), htmlspecialchars($ip));
- ACTIONLOG::add(INFO, $info);
- }
- }
- }
-
- function event_LoginSuccess(&$data) {
- //member(obj),username
- if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
- global $_SERVER;
- $login = $data['username'];
- $ip = $_SERVER['REMOTE_ADDR'];
+ $info = sprintf(_SECURITYENFORCER_LOGIN_DISALLOWED, htmlspecialchars($login), htmlspecialchars($ip));
+ ACTIONLOG::add(INFO, $info);
+ }
+ }
+ }
+
+ function event_LoginSuccess($data) {
+ //member(obj),username
+ if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
+ global $_SERVER;
+ $login = $data['username'];
+ $ip = $_SERVER['REMOTE_ADDR'];
// sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".addslashes($login)."'");
- sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");
+ sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");
// sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".addslashes($ip)."'");
- sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($ip)."'");
- }
- }
-
- function event_LoginFailed(&$data) {
- //username
- if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
- global $_SERVER;
- $login = $data['username'];
- $ip = $_SERVER['REMOTE_ADDR'];
- //sql_table('plug_securityenforcer')
+ sql_query("DELETE FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($ip)."'");
+ }
+ }
+
+ function event_LoginFailed($data) {
+ //username
+ if ($this->enable_security == 'yes' && $this->max_failed_login > 0) {
+ global $_SERVER;
+ $login = $data['username'];
+ $ip = $_SERVER['REMOTE_ADDR'];
+ //sql_table('plug_securityenforcer')
// $lres = sql_query("SELECT * FROM ".sql_table('plug_securityenforcer')." WHERE login='".addslashes($login)."'");
- $lres = sql_query("SELECT * FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");
- if (sql_num_rows($lres)) {
+ $lres = sql_query("SELECT * FROM ".sql_table('plug_securityenforcer')." WHERE login='".sql_real_escape_string($login)."'");
+ if (sql_num_rows($lres)) {
// sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".addslashes($login)."'");
- sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".sql_real_escape_string($login)."'");
- }
- else {
+ sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".sql_real_escape_string($login)."'");
+ }
+ else {
// sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".addslashes($login)."',1,".time().")");
- sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".sql_real_escape_string($login)."',1,".time().")");
- }
- $lres = sql_query("SELECT * FROM ".sql_table('plug_securityenforcer')." WHERE login='".addslashes($ip)."'");
- if (sql_num_rows($lres)) {
+ sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".sql_real_escape_string($login)."',1,".time().")");
+ }
+ $lres = sql_query("SELECT * FROM ".sql_table('plug_securityenforcer')." WHERE login='".addslashes($ip)."'");
+ if (sql_num_rows($lres)) {
// sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".addslashes($ip)."'");
- sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".sql_real_escape_string($ip)."'");
- }
- else {
+ sql_query("UPDATE ".sql_table('plug_securityenforcer')." SET fails=fails+1, lastfail=".time()." WHERE login='".sql_real_escape_string($ip)."'");
+ }
+ else {
// sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".addslashes($ip)."',1,".time().")");
- sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".sql_real_escape_string($ip)."',1,".time().")");
- }
- }
- }
-
- /* Helper Functions */
-
- function _validate_passwd($passwd,$minlength = 6,$complexity = 0) {
- $minlength = intval($minlength);
- $complexity = intval($complexity);
-
- if ($minlength < 6 ) $minlength = 6;
- if (strlen($passwd) < $minlength) return false;
+ sql_query("INSERT INTO ".sql_table('plug_securityenforcer')." (login,fails,lastfail) VALUES ('".sql_real_escape_string($ip)."',1,".time().")");
+ }
+ }
+ }
+
+ /* Helper Functions */
+
+ function _validate_passwd($passwd,$minlength = 6,$complexity = 0) {
+ $minlength = intval($minlength);
+ $complexity = intval($complexity);
+
+ if ($minlength < 6 ) $minlength = 6;
+ if (strlen($passwd) < $minlength) return false;
- if ($complexity > 4) $complexity = 4;
- $ucchars = "[A-Z]";
- $lcchars = "[a-z]";
- $numchars = "[0-9]";
- $ochars = "[-~!@#$%^&*()_+=,.<>?:;|]";
- $chartypes = array($ucchars, $lcchars, $numchars, $ochars);
- $tot = array(0,0,0,0);
- $i = 0;
- foreach ($chartypes as $value) {
- $tot[$i] = preg_match("/".$value."/", $passwd);
- $i = $i + 1;
- }
+ if ($complexity > 4) $complexity = 4;
+ $ucchars = "[A-Z]";
+ $lcchars = "[a-z]";
+ $numchars = "[0-9]";
+ $ochars = "[-~!@#$%^&*()_+=,.<>?:;|]";
+ $chartypes = array($ucchars, $lcchars, $numchars, $ochars);
+ $tot = array(0,0,0,0);
+ $i = 0;
+ foreach ($chartypes as $value) {
+ $tot[$i] = preg_match("/".$value."/", $passwd);
+ $i = $i + 1;
+ }
- if (array_sum($tot) >= $complexity) return true;
- else return false;
- }
+ if (array_sum($tot) >= $complexity) return true;
+ else return false;
+ }
}
?>
\ No newline at end of file