fix indentation

This commit is contained in:
fabrixxm 2014-09-07 11:31:42 +02:00
parent 9368c7e510
commit fe02619114

View file

@ -419,9 +419,9 @@ function admin_page_site_post(&$a){
set_config('system','banner', $banner); set_config('system','banner', $banner);
} }
if ($info=="") { if ($info=="") {
del_config('config','info'); del_config('config','info');
} else { } else {
set_config('config','info',$info); set_config('config','info',$info);
} }
set_config('system','language', $language); set_config('system','language', $language);
set_config('system','theme', $theme); set_config('system','theme', $theme);
@ -429,12 +429,12 @@ function admin_page_site_post(&$a){
del_config('system','mobile-theme'); del_config('system','mobile-theme');
} else { } else {
set_config('system','mobile-theme', $theme_mobile); set_config('system','mobile-theme', $theme_mobile);
} }
if ( $singleuser === '---' ) { if ( $singleuser === '---' ) {
del_config('system','singleuser'); del_config('system','singleuser');
} else { } else {
set_config('system','singleuser', $singleuser); set_config('system','singleuser', $singleuser);
} }
set_config('system','maximagesize', $maximagesize); set_config('system','maximagesize', $maximagesize);
set_config('system','max_image_length', $maximagelength); set_config('system','max_image_length', $maximagelength);
set_config('system','jpeg_quality', $jpegimagequality); set_config('system','jpeg_quality', $jpegimagequality);
@ -473,7 +473,7 @@ function admin_page_site_post(&$a){
set_config('system','curl_timeout', $timeout); set_config('system','curl_timeout', $timeout);
set_config('system','dfrn_only', $dfrn_only); set_config('system','dfrn_only', $dfrn_only);
set_config('system','ostatus_disabled', $ostatus_disabled); set_config('system','ostatus_disabled', $ostatus_disabled);
set_config('system','ostatus_poll_interval', $ostatus_poll_interval); set_config('system','ostatus_poll_interval', $ostatus_poll_interval);
set_config('system','diaspora_enabled', $diaspora_enabled); set_config('system','diaspora_enabled', $diaspora_enabled);
set_config('config','private_addons', $private_addons); set_config('config','private_addons', $private_addons);
@ -524,32 +524,32 @@ function admin_page_site(&$a) {
foreach($files as $file) { foreach($files as $file) {
$f = basename($file); $f = basename($file);
$theme_name = ((file_exists($file . '/experimental')) ? sprintf("%s - \x28Experimental\x29", $f) : $f); $theme_name = ((file_exists($file . '/experimental')) ? sprintf("%s - \x28Experimental\x29", $f) : $f);
if (file_exists($file . '/mobile')) { if (file_exists($file . '/mobile')) {
$theme_choices_mobile[$f] = $theme_name; $theme_choices_mobile[$f] = $theme_name;
} }
else { else {
$theme_choices[$f] = $theme_name; $theme_choices[$f] = $theme_name;
} }
} }
} }
/* OStatus conversation poll choices */ /* OStatus conversation poll choices */
$ostatus_poll_choices = array( $ostatus_poll_choices = array(
"-2" => t("Never"), "-2" => t("Never"),
"-1" => t("At post arrival"), "-1" => t("At post arrival"),
"0" => t("Frequently"), "0" => t("Frequently"),
"60" => t("Hourly"), "60" => t("Hourly"),
"720" => t("Twice daily"), "720" => t("Twice daily"),
"1440" => t("Daily") "1440" => t("Daily")
); );
/* get user names to make the install a personal install of X */ /* get user names to make the install a personal install of X */
$user_names = array(); $user_names = array();
$user_names['---'] = t('Multi user instance'); $user_names['---'] = t('Multi user instance');
$users = q("SELECT username, nickname FROM `user`"); $users = q("SELECT username, nickname FROM `user`");
foreach ($users as $user) { foreach ($users as $user) {
$user_names[$user['nickname']] = $user['username']; $user_names[$user['nickname']] = $user['username'];
} }
/* Banner */ /* Banner */
$banner = get_config('system','banner'); $banner = get_config('system','banner');
@ -651,7 +651,7 @@ function admin_page_site(&$a) {
'$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."), '$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."),
'$enable_noscrape'=> array('enable_noscrape', t("Enable noscrape"), get_config('system','enable_noscrape'), t("The noscrape feature speeds up directory submissions by using JSON data instead of HTML scraping.")), '$enable_noscrape'=> array('enable_noscrape', t("Enable noscrape"), get_config('system','enable_noscrape'), t("The noscrape feature speeds up directory submissions by using JSON data instead of HTML scraping.")),
'$form_security_token' => get_form_security_token("admin_site") '$form_security_token' => get_form_security_token("admin_site")
)); ));
@ -745,38 +745,39 @@ function admin_page_users_post(&$a){
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : Array() ); $pending = ( x($_POST, 'pending') ? $_POST['pending'] : Array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : Array() ); $users = ( x($_POST, 'user') ? $_POST['user'] : Array() );
$nu_name = ( x($_POST, 'new_user_name') ? $_POST['new_user_name'] : ''); $nu_name = ( x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '');
$nu_nickname = ( x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : ''); $nu_nickname = ( x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '');
$nu_email = ( x($_POST, 'new_user_email') ? $_POST['new_user_email'] : ''); $nu_email = ( x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '');
check_form_security_token_redirectOnErr('/admin/users', 'admin_users'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) { if (!($nu_name==="") && !($nu_email==="") && !($nu_nickname==="")) {
require_once('include/user.php'); require_once('include/user.php');
require_once('include/email.php'); require_once('include/email.php');
$result = create_user( array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1) ); $result = create_user( array('username'=>$nu_name, 'email'=>$nu_email, 'nickname'=>$nu_nickname, 'verified'=>1) );
if(! $result['success']) { if(! $result['success']) {
notice($result['message']); notice($result['message']);
return; return;
} }
$nu = $result['user']; $nu = $result['user'];
$email_tpl = get_intltext_template("register_adminadd_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
'$username' => $nu['username'],
'$email' => $nu['email'],
'$password' => $result['password'],
'$uid' => $nu['uid'] ));
$res = mail($nu['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'), $email_tpl = get_intltext_template("register_adminadd_eml.tpl");
$email_tpl, $email_tpl = replace_macros($email_tpl, array(
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" '$sitename' => $a->config['sitename'],
. 'Content-type: text/plain; charset=UTF-8' . "\n" '$siteurl' => $a->get_baseurl(),
. 'Content-transfer-encoding: 8bit' ); '$username' => $nu['username'],
if ($res) { '$email' => $nu['email'],
info( t('Registration successful. Email send to user').EOL ); '$password' => $result['password'],
} '$uid' => $nu['uid'] ));
}
$res = mail($nu['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'),
$email_tpl,
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
if ($res) {
info( t('Registration successful. Email send to user').EOL );
}
}
if (x($_POST,'page_users_block')){ if (x($_POST,'page_users_block')){
foreach($users as $uid){ foreach($users as $uid){
@ -825,7 +826,7 @@ function admin_page_users(&$a){
} }
switch($a->argv[2]){ switch($a->argv[2]){
case "delete":{ case "delete":{
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
// delete user // delete user
require_once("include/Contact.php"); require_once("include/Contact.php");
user_remove($uid); user_remove($uid);
@ -833,7 +834,7 @@ function admin_page_users(&$a){
notice( sprintf(t("User '%s' deleted"), $user[0]['username']) . EOL); notice( sprintf(t("User '%s' deleted"), $user[0]['username']) . EOL);
}; break; }; break;
case "block":{ case "block":{
check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't'); check_form_security_token_redirectOnErr('/admin/users', 'admin_users', 't');
q("UPDATE `user` SET `blocked`=%d WHERE `uid`=%s", q("UPDATE `user` SET `blocked`=%d WHERE `uid`=%s",
intval( 1-$user[0]['blocked'] ), intval( 1-$user[0]['blocked'] ),
intval( $uid ) intval( $uid )
@ -889,7 +890,7 @@ function admin_page_users(&$a){
t('Normal Account'), t('Normal Account'),
t('Soapbox Account'), t('Soapbox Account'),
t('Community/Celebrity Account'), t('Community/Celebrity Account'),
t('Automatic Friend Account') t('Automatic Friend Account')
); );
$e['page-flags'] = $accounts[$e['page-flags']]; $e['page-flags'] = $accounts[$e['page-flags']];
$e['register_date'] = relative_date($e['register_date']); $e['register_date'] = relative_date($e['register_date']);
@ -1094,7 +1095,7 @@ function admin_page_plugins(&$a){
'$baseurl' => $a->get_baseurl(true), '$baseurl' => $a->get_baseurl(true),
'$function' => 'plugins', '$function' => 'plugins',
'$plugins' => $plugins, '$plugins' => $plugins,
'$form_security_token' => get_form_security_token("admin_themes"), '$form_security_token' => get_form_security_token("admin_themes"),
)); ));
} }
@ -1296,7 +1297,7 @@ function admin_page_themes(&$a){
'$plugins' => $xthemes, '$plugins' => $xthemes,
'$experimental' => t('[Experimental]'), '$experimental' => t('[Experimental]'),
'$unsupported' => t('[Unsupported]'), '$unsupported' => t('[Unsupported]'),
'$form_security_token' => get_form_security_token("admin_themes"), '$form_security_token' => get_form_security_token("admin_themes"),
)); ));
} }
@ -1309,7 +1310,7 @@ function admin_page_themes(&$a){
function admin_page_logs_post(&$a) { function admin_page_logs_post(&$a) {
if (x($_POST,"page_logs")) { if (x($_POST,"page_logs")) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs'); check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
$logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : ''); $logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
$debugging = ((x($_POST,'debugging')) ? true : false); $debugging = ((x($_POST,'debugging')) ? true : false);
@ -1388,7 +1389,7 @@ readable.");
'$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")), '$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")),
'$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices), '$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices),
'$form_security_token' => get_form_security_token("admin_logs"), '$form_security_token' => get_form_security_token("admin_logs"),
)); ));
} }