fix indentation

This commit is contained in:
fabrixxm 2014-09-07 11:31:42 +02:00
parent 9368c7e510
commit fe02619114
1 changed files with 67 additions and 66 deletions

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');
@ -626,9 +626,9 @@ function admin_page_site(&$a) {
'$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")), '$no_regfullname' => array('no_regfullname', t("Fullname check"), !get_config('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),
'$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")), '$no_utf' => array('no_utf', t("UTF-8 Regular expressions"), !get_config('system','no_utf'), t("Use PHP UTF8 regular expressions")),
'$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")), '$no_community_page' => array('no_community_page', t("Show Community Page"), !get_config('system','no_community_page'), t("Display a Community page showing all recent public postings on this site.")),
'$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")), '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
'$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices), '$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices),
'$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")), '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), get_config('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")),
'$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")), '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), get_config('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")),
'$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")), '$verifyssl' => array('verifyssl', t("Verify SSL"), get_config('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""), '$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
@ -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")
)); ));
@ -744,39 +744,40 @@ function admin_page_dbsync(&$a) {
function admin_page_users_post(&$a){ 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( $email_tpl = get_intltext_template("register_adminadd_eml.tpl");
'$sitename' => $a->config['sitename'], $email_tpl = replace_macros($email_tpl, array(
'$siteurl' => $a->get_baseurl(), '$sitename' => $a->config['sitename'],
'$username' => $nu['username'], '$siteurl' => $a->get_baseurl(),
'$email' => $nu['email'], '$username' => $nu['username'],
'$password' => $result['password'], '$email' => $nu['email'],
'$uid' => $nu['uid'] )); '$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, $res = mail($nu['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'),
'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n" $email_tpl,
. 'Content-type: text/plain; charset=UTF-8' . "\n" 'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-transfer-encoding: 8bit' ); . 'Content-type: text/plain; charset=UTF-8' . "\n"
if ($res) { . 'Content-transfer-encoding: 8bit' );
info( t('Registration successful. Email send to user').EOL ); 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);
@ -1348,7 +1349,7 @@ function admin_page_logs(&$a){
$data = ''; $data = '';
if(!file_exists($f)) { if(!file_exists($f)) {
$data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is $data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is
readable."); readable.");
} }
else { else {
@ -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"),
)); ));
} }