From: Bart Visscher Date: Mon, 26 Sep 2011 19:10:56 +0000 (+0200) Subject: Add email field to personal preferences X-Git-Tag: v3.0~101^2~22^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f14930389505eda61ec4cbcdf59a54e63513802b;p=nextcloud-server.git Add email field to personal preferences --- diff --git a/settings/ajax/lostpassword.php b/settings/ajax/lostpassword.php new file mode 100644 index 00000000000..a2dfc033206 --- /dev/null +++ b/settings/ajax/lostpassword.php @@ -0,0 +1,19 @@ + array( "message" => $l->t("email Changed") ))); +}else{ + OC_JSON::error(array("data" => array( "message" => $l->t("Invalid request") ))); +} + +?> diff --git a/settings/js/personal.js b/settings/js/personal.js index 9578fb2c890..8108da433c8 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -32,6 +32,15 @@ $(document).ready(function(){ }); + $('#lostpassword #email').blur(function(event){ + event.preventDefault(); + OC.msg.startSaving('#lostpassword .msg'); + var post = $( "#lostpassword" ).serialize(); + $.post( 'ajax/lostpassword.php', post, function(data){ + OC.msg.finishedSaving('#lostpassword .msg', data); + }); + }); + $("#languageinput").chosen(); $("#languageinput").change( function(){ diff --git a/settings/personal.php b/settings/personal.php index 05dbda473ac..687b1a7aa34 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -19,6 +19,8 @@ $free=OC_Filesystem::free_space(); $total=$free+$used; $relative=round(($used/$total)*10000)/100; +$email=OC_Preferences::getValue(OC_User::getUser(), 'settings','email',''); + $lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', 'en' ); $languageCodes=OC_L10N::findAvailableLanguages(); //put the current language in the front @@ -35,6 +37,7 @@ $tmpl = new OC_Template( "settings", "personal", "user"); $tmpl->assign('usage',OC_Helper::humanFileSize($used)); $tmpl->assign('total_space',OC_Helper::humanFileSize($total)); $tmpl->assign('usage_relative',$relative); +$tmpl->assign('email',$email); $tmpl->assign('languages',$languages); $forms=OC_App::getForms('personal'); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index eee5f3979c3..61ee0354b14 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -19,6 +19,14 @@ +
+
+ +
+ t('Fill in an email address to enable password recovery');?> +
+
+