Permalink
Browse files

Merge branch 'stable4' of git://gitorious.org/owncloud/owncloud into …

…stable4
  • Loading branch information...
2 parents 454f81f + daa4d2c commit ae2bcf968d9065d2619981131c6acddb50ef871e @blizzz blizzz committed Jun 4, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 settings/ajax/lostpassword.php
View
9 settings/ajax/lostpassword.php
@@ -8,12 +8,11 @@
$l=OC_L10N::get('core');
// Get data
-if( isset( $_POST['email'] ) ){
- $email=trim($_POST['email']);
+if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ){
$email=trim($_POST['email']);
- OC_JSON::success(array("data" => array( "message" => $l->t("email Changed") )));
+ OC_Preferences::setValue(OC_User::getUser(),'settings','email',$email);
OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
- OC_JSON::error(array("data" => array( "message" => $l->t("Invalid request") )));
+}else{
OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
}
-?>
+

0 comments on commit ae2bcf9

Please sign in to comment.