From 83f161d3f964a48f6dbe92e69233575b1984c547 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 14 Feb 2013 23:29:51 +0100 Subject: [PATCH] Style cleanup settings --- settings/ajax/setquota.php | 4 +++- settings/ajax/togglegroups.php | 4 +++- settings/oauth.php | 21 ++++++++++++--------- settings/routes.php | 2 +- settings/templates/apps.php | 23 +++++++++++++++-------- settings/templates/help.php | 18 ++++++++++++------ settings/templates/personal.php | 20 ++++++++++++++------ settings/users.php | 6 ++++-- 8 files changed, 64 insertions(+), 34 deletions(-) diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index 356466c0c0..cd8dc0e279 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -10,7 +10,9 @@ OCP\JSON::callCheck(); $username = isset($_POST["username"])?$_POST["username"]:''; -if(($username == '' && !OC_User::isAdminUser(OC_User::getUser()))|| (!OC_User::isAdminUser(OC_User::getUser()) && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username))) { +if(($username == '' && !OC_User::isAdminUser(OC_User::getUser())) + || (!OC_User::isAdminUser(OC_User::getUser()) + && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username))) { $l = OC_L10N::get('core'); OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); diff --git a/settings/ajax/togglegroups.php b/settings/ajax/togglegroups.php index 9bba9c5269..f6fd9aba6d 100644 --- a/settings/ajax/togglegroups.php +++ b/settings/ajax/togglegroups.php @@ -13,7 +13,9 @@ if($username == OC_User::getUser() && $group == "admin" && OC_User::isAdminUser exit(); } -if(!OC_User::isAdminUser(OC_User::getUser()) && (!OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username) || !OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group))) { +if(!OC_User::isAdminUser(OC_User::getUser()) + && (!OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username) + || !OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group))) { $l = OC_L10N::get('core'); OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); diff --git a/settings/oauth.php b/settings/oauth.php index 07b7ae5c31..8b4759f999 100644 --- a/settings/oauth.php +++ b/settings/oauth.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); +require_once '../lib/base.php'; // Logic $operation = isset($_GET['operation']) ? $_GET['operation'] : ''; $server = OC_OAuth_server::init(); @@ -23,9 +23,10 @@ switch($operation){ $callbackfail = empty($_GET['callback_fail']) ? null : $_GET['callback_fail']; $consumer = OC_OAuth_Server::register_consumer($_GET['name'], $_GET['url'], $callbacksuccess, $callbackfail); - echo 'Registered consumer successfully!

Key: ' . $consumer->key . '
Secret: ' . $consumer->secret; + echo 'Registered consumer successfully!

Key: ' . $consumer->key + . '
Secret: ' . $consumer->secret; } - break; + break; case 'request_token': @@ -38,7 +39,7 @@ switch($operation){ echo $exception->getMessage(); } - break; + break; case 'authorise'; OC_API::checkLoggedIn(); @@ -61,9 +62,11 @@ switch($operation){ if(!empty($notfound)) { // We need more apps :( Show error if(count($notfound)==1) { - $message = 'requires that you have an extra app installed on your ownCloud. Please contact your ownCloud administrator and ask them to install the app below.'; + $message = 'requires that you have an extra app installed on your ownCloud.' + .' Please contact your ownCloud administrator and ask them to install the app below.'; } else { - $message = 'requires that you have some extra apps installed on your ownCloud. Please contract your ownCloud administrator and ask them to install the apps below.'; + $message = 'requires that you have some extra apps installed on your ownCloud.' + .' Please contract your ownCloud administrator and ask them to install the apps below.'; } $t = new OC_Template('settings', 'oauth-required-apps', 'guest'); OC_Util::addStyle('settings', 'oauth'); @@ -77,7 +80,7 @@ switch($operation){ $t->assign('consumer', $consumer); $t->printPage(); } - break; + break; case 'access_token'; try { @@ -89,10 +92,10 @@ switch($operation){ echo $exception->getMessage(); } - break; + break; default: // Something went wrong, we need an operation! OC_Response::setStatus(400); - break; + break; } diff --git a/settings/routes.php b/settings/routes.php index 0a8af0dde2..26d933dba4 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -40,7 +40,7 @@ $this->create('settings_ajax_removegroup', '/settings/ajax/removegroup.php') $this->create('settings_ajax_changepassword', '/settings/ajax/changepassword.php') ->actionInclude('settings/ajax/changepassword.php'); $this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php') -->actionInclude('settings/ajax/changedisplayname.php'); + ->actionInclude('settings/ajax/changedisplayname.php'); // personel $this->create('settings_ajax_lostpassword', '/settings/ajax/lostpassword.php') ->actionInclude('settings/ajax/lostpassword.php'); diff --git a/settings/templates/apps.php b/settings/templates/apps.php index ed1232ac32..b6e98c41bd 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -3,7 +3,8 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */?> - +
@@ -12,21 +13,27 @@
-

t('Select an App');?>

+

t('Select an App');?>

- - + +
diff --git a/settings/templates/help.php b/settings/templates/help.php index 315cbfdb9a..7b2a3321c2 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -1,14 +1,20 @@
diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 6e9ad5e1ac..e6f9e38189 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -5,7 +5,8 @@ */?>
-

t('You have used %s of the available %s', array($_['usage'], $_['total_space']));?>

+

t('You have used %s of the available %s', + array($_['usage'], $_['total_space']));?>

@@ -37,7 +38,8 @@ if($_['passwordChangeSupported']) {
t('Your password was changed');?>
t('Unable to change your password');?>
- + @@ -66,7 +68,8 @@ if($_['displayNameChangeSupported']) {
t('Email');?> -
+
t('Fill in an email address to enable password recovery');?>
@@ -79,7 +82,8 @@ if($_['displayNameChangeSupported']) { - t('Help translate');?> + t('Help translate');?> @@ -96,8 +100,12 @@ if($_['displayNameChangeSupported']) {
t('Version');?> - ownCloud
- t('Developed by the ownCloud community, the source code is licensed under the AGPL.'); ?> + ownCloud +
+ t('Developed by the ownCloud community,' + .' the source code is licensed' + .' under the AGPL.'); ?>
diff --git a/settings/users.php b/settings/users.php index 7fcd1d3ed0..94e6d0a9a1 100644 --- a/settings/users.php +++ b/settings/users.php @@ -40,12 +40,14 @@ foreach($quotaPreset as &$preset) { $quotaPreset=array_diff($quotaPreset, array('default', 'none')); $defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); -$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false && array_search($defaultQuota, array('none', 'default'))===false; +$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false + && array_search($defaultQuota, array('none', 'default'))===false; // load users and quota foreach($accessibleusers as $uid => $displayName) { $quota=OC_Preferences::getValue($uid, 'files', 'quota', 'default'); - $isQuotaUserDefined=array_search($quota, $quotaPreset)===false && array_search($quota, array('none', 'default'))===false; + $isQuotaUserDefined=array_search($quota, $quotaPreset)===false + && array_search($quota, array('none', 'default'))===false; $name = $displayName; if ( $displayName != $uid ) {