Zeile 65 | Zeile 65 |
---|
// Prevent any shut down functions from running $done_shutdown = 1;
|
// Prevent any shut down functions from running $done_shutdown = 1;
|
// Include the necessary contants for installation
| // Include the necessary constants for installation
|
$grouppermignore = array('gid', 'type', 'title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image'); $groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperthread'); $displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');
| $grouppermignore = array('gid', 'type', 'title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image'); $groupzerogreater = array('pmquota', 'maxpmrecipients', 'maxreputationsday', 'attachquota', 'maxemails', 'maxwarningsday', 'maxposts', 'edittimelimit', 'canusesigxposts', 'maxreputationsperthread'); $displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image');
|
Zeile 186 | Zeile 186 |
---|
} }
|
} }
|
| /** * Welcome page */
|
function intro() { global $output, $mybb, $lang;
|
function intro() { global $output, $mybb, $lang;
|
|
|
$output->print_header($lang->welcome, 'welcome'); if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false) {
| $output->print_header($lang->welcome, 'welcome'); if(strpos(strtolower(get_current_location('', '', true)), '/upload/') !== false) {
|
Zeile 199 | Zeile 202 |
---|
$output->print_footer('license'); }
|
$output->print_footer('license'); }
|
| /** * Show the license agreement */
|
function license_agreement() { global $output, $lang, $mybb;
| function license_agreement() { global $output, $lang, $mybb;
|
Zeile 255 | Zeile 261 |
---|
Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
|
Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
|
|
|
The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
|
The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
|
|
|
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
| 1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
|
Zeile 273 | Zeile 279 |
---|
that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
|
that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
|
|
|
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs
| a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs
|
Zeile 290 | Zeile 296 |
---|
material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
|
material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
|
|
|
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
| a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
|
Zeile 464 | Zeile 470 |
---|
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
|
|
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
| "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
|
Zeile 1013 | Zeile 1019 |
---|
$output->print_footer('requirements_check'); }
|
$output->print_footer('requirements_check'); }
|
| /** * Check our requirements */
|
function requirements_check() { global $output, $mybb, $dboptions, $lang;
| function requirements_check() { global $output, $mybb, $dboptions, $lang;
|
Zeile 1198 | Zeile 1207 |
---|
} }
|
} }
|
| /** * Which database do we use? */
|
function database_info() { global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
| function database_info() { global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
|
Zeile 1248 | Zeile 1260 |
---|
if($mybb->get_input('dbengine') == $dbfile) { $dbengines .= "<option value=\"{$dbfile}\" selected=\"selected\">{$dbtype['title']}</option>";
|
if($mybb->get_input('dbengine') == $dbfile) { $dbengines .= "<option value=\"{$dbfile}\" selected=\"selected\">{$dbtype['title']}</option>";
|
}
| }
|
else { $dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
| else { $dbengines .= "<option value=\"{$dbfile}\">{$dbtype['title']}</option>";
|
Zeile 1286 | Zeile 1298 |
---|
if(empty($mybb->input['config'][$dbfile]['encoding'])) { $mybb->input['config'][$dbfile]['encoding'] = "utf8";
|
if(empty($mybb->input['config'][$dbfile]['encoding'])) { $mybb->input['config'][$dbfile]['encoding'] = "utf8";
|
}
| }
|
$class = ''; if(empty($first) && !$mybb->get_input('dbengine'))
|
$class = ''; if(empty($first) && !$mybb->get_input('dbengine'))
|
{
| {
|
$mybb->input['dbengine'] = $dbfile; $first = true; } if($dbfile == $mybb->input['dbengine']) { $class = "_selected";
|
$mybb->input['dbengine'] = $dbfile; $first = true; } if($dbfile == $mybb->input['dbengine']) { $class = "_selected";
|
}
| }
|
$db_info[$dbfile] = " <tbody id=\"{$dbfile}_settings\" class=\"db_settings db_type{$class}\"> <tr>
| $db_info[$dbfile] = " <tbody id=\"{$dbfile}_settings\" class=\"db_settings db_type{$class}\"> <tr>
|
Zeile 1307 | Zeile 1319 |
---|
// SQLite gets some special settings if($dbfile == 'sqlite')
|
// SQLite gets some special settings if($dbfile == 'sqlite')
|
{ $db_info[$dbfile] .= " <tr class=\"alt_row\">
| { $db_info[$dbfile] .= " <tr class=\"alt_row\">
|
<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_path}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td> </tr>"; } // Others get db host, username, password etc else
|
<td class=\"first\"><label for=\"config_{$dbfile}_dbname\">{$lang->database_path}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbname]\" id=\"config_{$dbfile}_dbname\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbname'])."\" /></td> </tr>"; } // Others get db host, username, password etc else
|
{ $db_info[$dbfile] .= " <tr class=\"alt_row\">
| { $db_info[$dbfile] .= " <tr class=\"alt_row\">
|
<td class=\"first\"><label for=\"config_{$dbfile}_dbhost\">{$lang->database_host}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbhost]\" id=\"config_{$dbfile}_dbhost\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbhost'])."\" /></td> </tr>
| <td class=\"first\"><label for=\"config_{$dbfile}_dbhost\">{$lang->database_host}</label></td> <td class=\"last alt_col\"><input type=\"text\" class=\"text_input\" name=\"config[{$dbfile}][dbhost]\" id=\"config_{$dbfile}_dbhost\" value=\"".htmlspecialchars_uni($mybb->input['config'][$dbfile]['dbhost'])."\" /></td> </tr>
|
Zeile 1356 | Zeile 1368 |
---|
if($mybb->input['config'][$dbfile]['encoding'] == $encoding) { $select_options .= "<option value=\"{$encoding}\" selected=\"selected\">{$title}</option>";
|
if($mybb->input['config'][$dbfile]['encoding'] == $encoding) { $select_options .= "<option value=\"{$encoding}\" selected=\"selected\">{$title}</option>";
|
}
| }
|
else { $select_options .= "<option value=\"{$encoding}\">{$title}</option>";
| else { $select_options .= "<option value=\"{$encoding}\">{$title}</option>";
|
Zeile 1376 | Zeile 1388 |
---|
$output->print_footer('create_tables'); }
|
$output->print_footer('create_tables'); }
|
| /** * Create our tables */
|
function create_tables() { global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
| function create_tables() { global $output, $dbinfo, $errors, $mybb, $dboptions, $lang;
|
Zeile 1613 | Zeile 1628 |
---|
$output->print_footer('populate_tables'); }
|
$output->print_footer('populate_tables'); }
|
| /** * Insert our default data */
|
function populate_tables() { global $output, $lang;
| function populate_tables() { global $output, $lang;
|
Zeile 1657 | Zeile 1675 |
---|
$output->print_footer('templates'); }
|
$output->print_footer('templates'); }
|
| /** * Install our theme */
|
function insert_templates() { global $mybb, $output, $cache, $db, $lang;
| function insert_templates() { global $mybb, $output, $cache, $db, $lang;
|
Zeile 1767 | Zeile 1788 |
---|
$output->print_footer('configuration'); }
|
$output->print_footer('configuration'); }
|
| /** * Default configuration */
|
function configure() { global $output, $mybb, $errors, $lang;
| function configure() { global $output, $mybb, $errors, $lang;
|
Zeile 1781 | Zeile 1805 |
---|
if(inp.value != inp.defaultValue) { if(!parenttr.next('.setting_peeker').length)
|
if(inp.value != inp.defaultValue) { if(!parenttr.next('.setting_peeker').length)
|
{
| {
|
var revertlink = ' <a href="javascript:revertSetting(\''+inp.defaultValue+'\', \'#'+inp.id+'\');">{$lang->config_step_revert}</a>'; parenttr.removeClass('last').after('<tr class="setting_peeker"><td colspan="2">'+warn+revertlink+'</td></tr>'); }
| var revertlink = ' <a href="javascript:revertSetting(\''+inp.defaultValue+'\', \'#'+inp.id+'\');">{$lang->config_step_revert}</a>'; parenttr.removeClass('last').after('<tr class="setting_peeker"><td colspan="2">'+warn+revertlink+'</td></tr>'); }
|
Zeile 1795 | Zeile 1819 |
---|
} function revertSetting(defval, inpid)
|
} function revertSetting(defval, inpid)
|
{
| {
|
$(inpid).val(defval); var parenttr = $(inpid).closest('tr'); parenttr.next('.setting_peeker').remove();
| $(inpid).val(defval); var parenttr = $(inpid).closest('tr'); parenttr.next('.setting_peeker').remove();
|
Zeile 1855 | Zeile 1879 |
---|
if(my_inet_pton($cookiedomain) !== false || strpos($cookiedomain, '.') === false) { $cookiedomain = '';
|
if(my_inet_pton($cookiedomain) !== false || strpos($cookiedomain, '.') === false) { $cookiedomain = '';
|
}
| }
|
else { $cookiedomain = ".{$cookiedomain}";
|
else { $cookiedomain = ".{$cookiedomain}";
|
}
| }
|
if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && !preg_match("#:[0-9]#i", $hostname)) { $hostname .= ':'.$_SERVER['SERVER_PORT'];
| if($_SERVER['SERVER_PORT'] && $_SERVER['SERVER_PORT'] != 80 && !preg_match("#:[0-9]#i", $hostname)) { $hostname .= ':'.$_SERVER['SERVER_PORT'];
|
Zeile 1879 | Zeile 1903 |
---|
$output->print_footer('adminuser'); }
|
$output->print_footer('adminuser'); }
|
| /** * How do we want to name the admin user? */
|
function create_admin_user() { global $output, $mybb, $errors, $db, $lang;
| function create_admin_user() { global $output, $mybb, $errors, $db, $lang;
|
Zeile 1890 | Zeile 1917 |
---|
if(empty($mybb->input['bburl'])) { $errors[] = $lang->config_step_error_url;
|
if(empty($mybb->input['bburl'])) { $errors[] = $lang->config_step_error_url;
|
}
| }
|
if(empty($mybb->input['bbname'])) { $errors[] = $lang->config_step_error_name;
| if(empty($mybb->input['bbname'])) { $errors[] = $lang->config_step_error_name;
|
Zeile 2028 | Zeile 2055 |
---|
'month' => $db->escape_string($task['month'][0]['value']), 'enabled' => $db->escape_string($task['enabled'][0]['value']), 'logging' => $db->escape_string($task['logging'][0]['value'])
|
'month' => $db->escape_string($task['month'][0]['value']), 'enabled' => $db->escape_string($task['enabled'][0]['value']), 'logging' => $db->escape_string($task['logging'][0]['value'])
|
);
| );
|
$new_task['nextrun'] = fetch_next_run($new_task);
$db->insert_query("tasks", $new_task);
| $new_task['nextrun'] = fetch_next_run($new_task);
$db->insert_query("tasks", $new_task);
|
Zeile 2110 | Zeile 2137 |
---|
$output->print_footer('final'); }
|
$output->print_footer('final'); }
|
| /** * Installation is finished */
|
function install_done() { global $output, $db, $mybb, $errors, $cache, $lang;
if(empty($mybb->input['adminuser']))
|
function install_done() { global $output, $db, $mybb, $errors, $cache, $lang;
if(empty($mybb->input['adminuser']))
|
{
| {
|
$errors[] = $lang->admin_step_error_nouser; } if(empty($mybb->input['adminpass'])) { $errors[] = $lang->admin_step_error_nopassword;
|
$errors[] = $lang->admin_step_error_nouser; } if(empty($mybb->input['adminpass'])) { $errors[] = $lang->admin_step_error_nopassword;
|
}
| }
|
if($mybb->get_input('adminpass') != $mybb->get_input('adminpass2')) { $errors[] = $lang->admin_step_error_nomatch; } if(empty($mybb->input['adminemail']))
|
if($mybb->get_input('adminpass') != $mybb->get_input('adminpass2')) { $errors[] = $lang->admin_step_error_nomatch; } if(empty($mybb->input['adminemail']))
|
{
| {
|
$errors[] = $lang->admin_step_error_noemail; } if(is_array($errors)) { create_admin_user();
|
$errors[] = $lang->admin_step_error_noemail; } if(is_array($errors)) { create_admin_user();
|
}
| }
|
require MYBB_ROOT.'inc/config.php'; $db = db_connection($config);
| require MYBB_ROOT.'inc/config.php'; $db = db_connection($config);
|
Zeile 2151 | Zeile 2181 |
---|
$parser = new XMLParser($usergroup_settings); $parser->collapse_dups = 0; $tree = $parser->get_tree();
|
$parser = new XMLParser($usergroup_settings); $parser->collapse_dups = 0; $tree = $parser->get_tree();
|
|
|
$admin_gid = ''; $group_count = 0; foreach($tree['usergroups'][0]['usergroup'] as $usergroup)
| $admin_gid = ''; $group_count = 0; foreach($tree['usergroups'][0]['usergroup'] as $usergroup)
|
Zeile 2168 | Zeile 2198 |
---|
$new_group[$key] = $db->escape_string($value[0]['value']); } $db->insert_query("usergroups", $new_group, false);
|
$new_group[$key] = $db->escape_string($value[0]['value']); } $db->insert_query("usergroups", $new_group, false);
|
|
|
// If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs) if($new_group['cancp'] == 1 && !$admin_gid) {
| // If this group can access the admin CP and we haven't established the admin group - set it (just in case we ever change IDs) if($new_group['cancp'] == 1 && !$admin_gid) {
|
Zeile 2215 | Zeile 2245 |
---|
'receivepms' => 1, 'pmnotice' => 1, 'pmnotify' => 1,
|
'receivepms' => 1, 'pmnotice' => 1, 'pmnotify' => 1,
|
| 'buddyrequestspm' => 1, 'buddyrequestsauto' => 0,
|
'showimages' => 1, 'showvideos' => 1, 'showsigs' => 1,
| 'showimages' => 1, 'showvideos' => 1, 'showsigs' => 1,
|
Zeile 2342 | Zeile 2374 |
---|
} sort($version_history, SORT_NUMERIC); $cache->update("version_history", $version_history);
|
} sort($version_history, SORT_NUMERIC); $cache->update("version_history", $version_history);
|
|
|
// Schedule an update check so it occurs an hour ago. Gotta stay up to date! $update['nextrun'] = TIME_NOW - 3600; $db->update_query("tasks", $update, "tid='12'");
| // Schedule an update check so it occurs an hour ago. Gotta stay up to date! $update['nextrun'] = TIME_NOW - 3600; $db->update_query("tasks", $update, "tid='12'");
|
Zeile 2351 | Zeile 2383 |
---|
$cache->update_tasks();
echo $lang->done . '</p>';
|
$cache->update_tasks();
echo $lang->done . '</p>';
|
|
|
echo $lang->done_step_success;
$written = 0; if(is_writable('./'))
|
echo $lang->done_step_success;
$written = 0; if(is_writable('./'))
|
{
| {
|
$lock = @fopen('./lock', 'w'); $written = @fwrite($lock, '1'); @fclose($lock);
| $lock = @fopen('./lock', 'w'); $written = @fwrite($lock, '1'); @fclose($lock);
|
Zeile 2364 | Zeile 2396 |
---|
{ echo $lang->done_step_locked; }
|
{ echo $lang->done_step_locked; }
|
}
| }
|
if(!$written) { echo $lang->done_step_dirdelete;
| if(!$written) { echo $lang->done_step_dirdelete;
|
Zeile 2373 | Zeile 2405 |
---|
$output->print_footer(''); }
|
$output->print_footer(''); }
|
| /** * @param array $config * * @return DB_MySQL|DB_MySQLi|DB_PgSQL|DB_SQLite */
|
function db_connection($config) { require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type'])
|
function db_connection($config) { require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php"; switch($config['database']['type'])
|
{
| {
|
case "sqlite": $db = new DB_SQLite; break;
| case "sqlite": $db = new DB_SQLite; break;
|
Zeile 2389 | Zeile 2426 |
---|
break; default: $db = new DB_MySQL;
|
break; default: $db = new DB_MySQL;
|
}
| }
|
// Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
| // Connect to Database define('TABLE_PREFIX', $config['database']['table_prefix']);
|
Zeile 2399 | Zeile 2436 |
---|
$db->type = $config['database']['type'];
return $db;
|
$db->type = $config['database']['type'];
return $db;
|
}
| }
|
|
|
| /** * @param array $array * * @return string */
|
function error_list($array) { $string = "<ul>\n";
| function error_list($array) { $string = "<ul>\n";
|
Zeile 2412 | Zeile 2454 |
---|
return $string; }
|
return $string; }
|
| /** * Write our settings to the settings file */
|
function write_settings() { global $db;
| function write_settings() { global $db;
|