/**
 * Create default groups, when migrating.
 *
 * @access private
 */
function serendipity_addDefaultGroups()
{
    global $serendipity;
    serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}groups");
    serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}groupconfig");
    serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}authorgroups");
    serendipity_addDefaultGroup(USERLEVEL_EDITOR_DESC, USERLEVEL_EDITOR);
    serendipity_addDefaultGroup(USERLEVEL_CHIEF_DESC, USERLEVEL_CHIEF);
    serendipity_addDefaultGroup(USERLEVEL_ADMIN_DESC, USERLEVEL_ADMIN);
}
Ejemplo n.º 2
0
     echo '<br />';
 } else {
     echo ' <strong>' . THEY_DONT . '</strong>';
     echo '<br />';
     echo CREATE_DATABASE;
     serendipity_installDatabase();
     echo ' <strong>' . DONE . '</strong><br />';
     echo sprintf(CREATING_PRIMARY_AUTHOR, htmlspecialchars($_POST['user'])) . '...';
     $authorid = serendipity_addAuthor($_POST['user'], $_POST['pass'], $_POST['realname'], $_POST['email'], USERLEVEL_ADMIN, 1);
     $mail_comments = serendipity_db_bool($_POST['want_mail']) ? 1 : 0;
     serendipity_set_user_var('mail_comments', $mail_comments, $authorid);
     serendipity_set_user_var('mail_trackbacks', $mail_comments, $authorid);
     serendipity_set_user_var('right_publish', 1, $authorid);
     serendipity_addDefaultGroup('USERLEVEL_EDITOR_DESC', USERLEVEL_EDITOR);
     serendipity_addDefaultGroup('USERLEVEL_CHIEF_DESC', USERLEVEL_CHIEF);
     serendipity_addDefaultGroup('USERLEVEL_ADMIN_DESC', USERLEVEL_ADMIN);
     echo ' <strong>' . DONE . '</strong><br />';
     echo SETTING_DEFAULT_TEMPLATE . '... ';
     serendipity_set_config_var('template', $serendipity['defaultTemplate']);
     echo ' <strong>' . DONE . '</strong><br />';
     echo INSTALLING_DEFAULT_PLUGINS . '... ';
     include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
     serendipity_plugin_api::register_default_plugins();
     echo ' <strong>' . DONE . '</strong><br />';
 }
 echo sprintf(ATTEMPT_WRITE_FILE, '.htaccess') . '... ';
 $errors = serendipity_installFiles($basedir);
 if ($errors === true) {
     echo ' <strong>' . DONE . '</strong><br />';
 } else {
     echo ' <strong>' . FAILED . '</strong><br />';