Example #1
0
 if (is_array($t)) {
     echo ' <strong>' . THEY_DO . '</strong>, ' . WONT_INSTALL_DB_AGAIN;
     echo '<br />';
     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) {
Example #2
0
                                continue;
                            }
                            unset($_POST[$item['var']][$groupkey]);
                        }
                    } else {
                        continue;
                    }
                    if (count($_POST[$item['var']]) < 1) {
                        echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
                    } else {
                        serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user'], false);
                    }
                    continue;
                }
                if (serendipity_checkConfigItemFlags($item, 'local')) {
                    serendipity_set_user_var($item['var'], $_POST[$item['var']], $serendipity['POST']['user'], $serendipity['authorid'] == $serendipity['POST']['user'] ? true : false);
                }
                if (serendipity_checkConfigItemFlags($item, 'configuration')) {
                    serendipity_set_config_var($item['var'], $_POST[$item['var']], $serendipity['POST']['user']);
                }
            }
        }
        $pl_data = array('id' => $serendipity['POST']['authorid'], 'authorid' => $serendipity['POST']['authorid'], 'username' => $_POST['username'], 'realname' => $_POST['realname'], 'email' => $_POST['email']);
        serendipity_updatePermalink($pl_data, 'author');
        serendipity_plugin_api::hook_event('backend_users_edit', $pl_data);
        printf('<div class="serendipityAdminMsgSuccess"><img style="height: 22px; width: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . MODIFIED_USER . '</div>', htmlspecialchars($_POST['realname']));
    }
}
if ($serendipity['GET']['adminAction'] != 'delete') {
    ?>
    <table width="100%">
Example #3
0
                                     echo '<div class="serendipityAdminMsgError"><img style="width: 22px; height: 22px; border: 0px; padding-right: 4px; vertical-align: middle" src="' . serendipity_getTemplateFile('admin/img/admin_msg_error.png') . '" alt="" />' . WARNING_NO_GROUPS_SELECTED . '</div>';
                                 } else {
                                     serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid'], false);
                                 }
             */
             continue;
         }
         // Moved to group administration:
         if ($item['var'] == 'userlevel') {
             continue;
         }
         if ($item['view'] == 'dangerous') {
             continue;
         }
         if (serendipity_checkConfigItemFlags($item, 'local')) {
             serendipity_set_user_var($item['var'], $_POST[$item['var']], $serendipity['authorid'], true);
         }
         if (serendipity_checkConfigItemFlags($item, 'configuration')) {
             serendipity_set_config_var($item['var'], $_POST[$item['var']], $serendipity['authorid']);
         }
     }
     $pl_data = array('id' => $serendipity['POST']['authorid'], 'authorid' => $serendipity['POST']['authorid'], 'username' => $_POST['username'], 'realname' => $_POST['realname'], 'email' => $_POST['email']);
     serendipity_updatePermalink($pl_data, 'author');
     serendipity_plugin_api::hook_event('backend_users_edit', $pl_data);
 }
 if ($serendipity['authorid'] === $_SESSION['serendipityAuthorid']) {
     if (is_null($serendipity['detected_lang'])) {
         $_SESSION['serendipityLanguage'] = $serendipity['lang'];
     }
 }
 $from = $_POST;
 /**
  *
  * edit properties from user
  *
  * @access private
  *
  * @param array $user  The Userproperties to edit
  *
  */
 function editUser(&$user)
 {
     global $serendipity;
     if (isset($serendipity['POST']['submitProfile']) && isset($serendipity['POST']['profilebirthday_day']) && isset($serendipity['POST']['profilebirthday_month']) && isset($serendipity['POST']['profilebirthday_year'])) {
         if ($re = checkdate($serendipity['POST']['profilebirthday_month'], $serendipity['POST']['profilebirthday_day'], $serendipity['POST']['profilebirthday_year'])) {
             $serendipity['POST']['profilebirthday'] = mktime(0, 0, 0, $serendipity['POST']['profilebirthday_month'], $serendipity['POST']['profilebirthday_day'], $serendipity['POST']['profilebirthday_year']);
         }
         unset($serendipity['POST']['profilebirthday_month'], $serendipity['POST']['profilebirthday_day'], $serendipity['POST']['profilebirthday_year']);
     }
     echo '<table border="0" cellspacing="0" cellpadding="3" width="100%">' . "\n";
     $local_properties =& $this->getLocalProperties();
     foreach ($local_properties as $property => $info) {
         if (isset($serendipity['POST']['submitProfile']) && isset($serendipity['POST']['profile' . $property])) {
             $user[$property] = $serendipity['POST']['profile' . $property];
             serendipity_set_user_var($property, $user[$property], $user['authorid'], false);
         }
         $this->showCol($property, $info, $user);
     }
     $profile =& $this->getConfigVars($user['authorid']);
     foreach ($this->properties as $property => $info) {
         if (isset($serendipity['POST']['submitProfile']) && isset($serendipity['POST']['profile' . $property])) {
             $user[$property] = $serendipity['POST']['profile' . $property];
             $this->updateConfigVar($property, $profile, $user[$property], $user['authorid']);
             $profile[$property] = $user[$property];
         } else {
             $user[$property] = $profile[$property];
         }
         $this->showCol($property, $info, $user);
     }
     echo "</table>\n";
     echo '<input class="serendipityPrettyButton input_button" type="submit" name="serendipity[submitProfile]" value="' . SAVE . '" />' . "\n\n";
 }