summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorSam Tuke <samtuke@owncloud.com>2013-02-06 15:08:53 +0000
committerSam Tuke <samtuke@owncloud.com>2013-02-06 15:08:53 +0000
commita3289d3991d9d7cc1b765163c832fa792fb3a146 (patch)
treeddc2d5911cd58b4db3fd7ae75e55a7d619df16ed /settings
parent6870add18f92d94ec520671dfa94021b340d7a4f (diff)
parentefdaea45576fb975f61c9ec4baa0421d4b832170 (diff)
downloadnextcloud-server-a3289d3991d9d7cc1b765163c832fa792fb3a146.tar.gz
nextcloud-server-a3289d3991d9d7cc1b765163c832fa792fb3a146.zip
Merge branch 'master' into files_encryption
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/changedisplayname.php7
-rw-r--r--settings/css/settings.css2
-rw-r--r--settings/js/apps.js4
-rw-r--r--settings/js/personal.js27
-rw-r--r--settings/l10n/es.php10
-rw-r--r--settings/l10n/fa.php15
-rw-r--r--settings/l10n/fr.php1
-rw-r--r--settings/personal.php3
-rw-r--r--settings/templates/personal.php24
9 files changed, 87 insertions, 6 deletions
diff --git a/settings/ajax/changedisplayname.php b/settings/ajax/changedisplayname.php
index f80ecb7a0c9..8f2ff865bd5 100644
--- a/settings/ajax/changedisplayname.php
+++ b/settings/ajax/changedisplayname.php
@@ -1,5 +1,6 @@
<?php
// Check if we are a user
+
OCP\JSON::callCheck();
OC_JSON::checkLoggedIn();
@@ -15,14 +16,14 @@ if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
}
if(is_null($userstatus)) {
- OC_JSON::error( array( "data" => array( "message" => "Authentication error" )));
+ OC_JSON::error( array( "data" => array( "message" => $l->t("Authentication error") )));
exit();
}
// Return Success story
if( OC_User::setDisplayName( $username, $displayName )) {
- OC_JSON::success(array("data" => array( "username" => $username )));
+ OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName )));
}
else{
- OC_JSON::error(array("data" => array( "message" => "Unable to change display name" )));
+ OC_JSON::error(array("data" => array( "message" => $l->t("Unable to change display name"), displayName => OC_User::getDisplayName($username) )));
} \ No newline at end of file
diff --git a/settings/css/settings.css b/settings/css/settings.css
index 5a3ab2c6e97..e722cca91ee 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -8,6 +8,8 @@ input#openid, input#webdav { width:20em; }
/* PERSONAL */
#passworderror { display:none; }
#passwordchanged { display:none; }
+#displaynameerror { display:none; }
+#displaynamechanged { display:none; }
input#identity { width:20em; }
#email { width: 17em; }
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 8bee958ec57..3bc3488e490 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -132,12 +132,12 @@ OC.Settings.Apps = OC.Settings.Apps || {
var container = $('#apps');
if(container.children('li[data-id="'+entry.id+'"]').length === 0){
- var li=$('<li></li>').attr({class: 'enabled-app'});
+ var li=$('<li></li>');
li.attr('data-id', entry.id);
var img= $('<img></img>').attr({ src: entry.icon, class:'icon'});
- li.append(img);
var a=$('<a></a>').attr('href', entry.href);
a.text(entry.name);
+ a.prepend(img);
li.append(a);
container.append(li);
}
diff --git a/settings/js/personal.js b/settings/js/personal.js
index a866e321ad6..d9455b3786b 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -31,6 +31,33 @@ $(document).ready(function(){
}
});
+
+ $("#displaynamebutton").click( function(){
+ if ($('#displayName').val() != '' ) {
+ // Serialize the data
+ var post = $( "#displaynameform" ).serialize();
+ $('#displaynamechanged').hide();
+ $('#displaynemerror').hide();
+ // Ajax foo
+ $.post( 'ajax/changedisplayname.php', post, function(data){
+ if( data.status == "success" ){
+ $('#displaynamechanged').show();
+ }
+ else{
+ $('#newdisplayname').val(data.data.displayName)
+ $('#displaynameerror').html( data.data.message );
+ $('#displaynameerror').show();
+ }
+ });
+ return false;
+ } else {
+ $('#displayName').val($('#oldDisplayName').val());
+ $('#displaynamechanged').hide();
+ $('#displaynameerror').show();
+ return false;
+ }
+
+ });
$('#lostpassword #email').blur(function(event){
if ($(this).val() == this.defaultValue){
diff --git a/settings/l10n/es.php b/settings/l10n/es.php
index 0b82c3b7f01..e0649587a44 100644
--- a/settings/l10n/es.php
+++ b/settings/l10n/es.php
@@ -13,9 +13,15 @@
"Admins can't remove themself from the admin group" => "Los administradores no se pueden eliminar a ellos mismos del grupo de administrador",
"Unable to add user to group %s" => "Imposible añadir el usuario al grupo %s",
"Unable to remove user from group %s" => "Imposible eliminar al usuario del grupo %s",
+"Couldn't update app." => "No se puedo actualizar la aplicacion.",
+"Update to {appversion}" => "Actualizado a {appversion}",
"Disable" => "Desactivar",
"Enable" => "Activar",
+"Please wait...." => "Espere por favor....",
+"Updating...." => "Actualizando....",
+"Error while updating app" => "Error mientras se actualizaba",
"Error" => "Error",
+"Updated" => "Actualizado",
"Saving..." => "Guardando...",
"__language_name__" => "Castellano",
"Add your App" => "Añade tu aplicación",
@@ -51,13 +57,17 @@
"Use this address to connect to your ownCloud in your file manager" => "Use esta dirección para conectarse a su cuenta de ownCloud en el administrador de archivos",
"Version" => "Version",
"Developed by the <a href=\"http://ownCloud.org/contact\" target=\"_blank\">ownCloud community</a>, the <a href=\"https://github.com/owncloud\" target=\"_blank\">source code</a> is licensed under the <a href=\"http://www.gnu.org/licenses/agpl-3.0.html\" target=\"_blank\"><abbr title=\"Affero General Public License\">AGPL</abbr></a>." => "Desarrollado por la <a href=\"http://ownCloud.org/contact\" target=\"_blank\">comunidad ownCloud</a>, el <a href=\"https://github.com/owncloud\" target=\"_blank\">código fuente</a> está bajo licencia <a href=\"http://www.gnu.org/licenses/agpl-3.0.html\" target=\"_blank\"><abbr title=\"Affero General Public License\">AGPL</abbr></a>.",
+"Login Name" => "Nombre de usuario",
"Groups" => "Grupos",
"Create" => "Crear",
"Default Storage" => "Almacenamiento Predeterminado",
"Unlimited" => "Ilimitado",
"Other" => "Otro",
+"Display Name" => "Nombre a mostrar",
"Group Admin" => "Grupo admin",
"Storage" => "Alamacenamiento",
+"change display name" => "Cambiar nombre a mostrar",
+"set new password" => "Configurar nueva contraseña",
"Default" => "Predeterminado",
"Delete" => "Eliminar"
);
diff --git a/settings/l10n/fa.php b/settings/l10n/fa.php
index 349af0e503f..0d35ddc226b 100644
--- a/settings/l10n/fa.php
+++ b/settings/l10n/fa.php
@@ -1,18 +1,28 @@
<?php $TRANSLATIONS = array(
"Unable to load list from App Store" => "قادر به بارگذاری لیست از فروشگاه اپ نیستم",
+"Group already exists" => "این گروه در حال حاضر موجود است",
+"Unable to add group" => "افزودن گروه امکان پذیر نیست",
"Email saved" => "ایمیل ذخیره شد",
"Invalid email" => "ایمیل غیر قابل قبول",
+"Unable to delete group" => "حذف گروه امکان پذیر نیست",
"Authentication error" => "خطا در اعتبار سنجی",
+"Unable to delete user" => "حذف کاربر امکان پذیر نیست",
"Language changed" => "زبان تغییر کرد",
"Invalid request" => "درخواست غیر قابل قبول",
"Disable" => "غیرفعال",
"Enable" => "فعال",
+"Please wait...." => "لطفا صبر کنید ...",
+"Updating...." => "در حال بروز رسانی...",
"Error" => "خطا",
+"Updated" => "بروز رسانی انجام شد",
"Saving..." => "درحال ذخیره ...",
"__language_name__" => "__language_name__",
"Add your App" => "برنامه خود را بیافزایید",
+"More Apps" => "برنامه های بیشتر",
"Select an App" => "یک برنامه انتخاب کنید",
"See application page at apps.owncloud.com" => "صفحه این اٌپ را در apps.owncloud.com ببینید",
+"Update" => "به روز رسانی",
+"Forum" => "انجمن",
"Clients" => "مشتریان",
"Password" => "گذرواژه",
"Your password was changed" => "رمز عبور شما تغییر یافت",
@@ -26,8 +36,13 @@
"Fill in an email address to enable password recovery" => "پست الکترونیکی را پرکنید تا بازیابی گذرواژه فعال شود",
"Language" => "زبان",
"Help translate" => "به ترجمه آن کمک کنید",
+"Version" => "نسخه",
"Groups" => "گروه ها",
"Create" => "ایجاد کردن",
+"Default Storage" => "ذخیره سازی پیش فرض",
+"Unlimited" => "نامحدود",
"Other" => "سایر",
+"Storage" => "حافظه",
+"Default" => "پیش فرض",
"Delete" => "پاک کردن"
);
diff --git a/settings/l10n/fr.php b/settings/l10n/fr.php
index 1e80ce13c1e..b870b56607c 100644
--- a/settings/l10n/fr.php
+++ b/settings/l10n/fr.php
@@ -18,6 +18,7 @@
"Disable" => "Désactiver",
"Enable" => "Activer",
"Please wait...." => "Veuillez patienter…",
+"Updating...." => "Mise à jour...",
"Error while updating app" => "Erreur lors de la mise à jour de l'application",
"Error" => "Erreur",
"Updated" => "Mise à jour effectuée avec succès",
diff --git a/settings/personal.php b/settings/personal.php
index 4624bda8397..ac2c4704edb 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -47,6 +47,9 @@ $tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total']));
$tmpl->assign('usage_relative', $storageInfo['relative']);
$tmpl->assign('email', $email);
$tmpl->assign('languages', $languages);
+$tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser()));
+$tmpl->assign('displayNameChangeSupported', OC_User::canUserChangeDisplayName(OC_User::getUser()));
+$tmpl->assign('displayName', OC_User::getDisplayName());
$forms=OC_App::getForms('personal');
$tmpl->assign('forms', array());
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 0e1677bdea8..0f195d86d3d 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -15,7 +15,9 @@
<a class="button" href="https://itunes.apple.com/us/app/owncloud/id543672169?mt=8" target="_blank"><?php echo $l->t('Download iOS Client');?></a>
</fieldset>
-
+<?php
+if($_['passwordChangeSupported']) {
+?>
<form id="passwordform">
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('Password');?></strong></legend>
@@ -27,6 +29,26 @@
<input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" />
</fieldset>
</form>
+<?php
+}
+?>
+
+<?php
+if($_['displayNameChangeSupported']) {
+?>
+<form id="displaynameform">
+ <fieldset class="personalblock">
+ <legend><strong><?php echo $l->t('Display Name');?></strong></legend>
+ <div id="displaynamechanged"><?php echo $l->t('Your display name was changed');?></div>
+ <div id="displaynameerror"><?php echo $l->t('Unable to change your display name');?></div>
+ <input type="text" id="displayName" name="displayName" value="<?php echo $_['displayName']?>" />
+ <input type="hidden" id="oldDisplayName" name="oldDisplayName" value="<?php echo $_['displayName']?>" />
+ <input id="displaynamebutton" type="submit" value="<?php echo $l->t('Change display name');?>" />
+ </fieldset>
+</form>
+<?php
+}
+?>
<form id="lostpassword">
<fieldset class="personalblock">