server/settings/ajax/lostpassword.php

16 lines
459 B
PHP
Raw Normal View History

<?php
OC_JSON::checkLoggedIn();
2012-07-07 13:27:04 +00:00
OCP\JSON::callCheck();
2012-04-14 14:44:15 +00:00
$l=OC_L10N::get('core');
// Get data
if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ) {
2012-06-04 20:24:13 +00:00
$email=trim($_POST['email']);
OC_Preferences::setValue(OC_User::getUser(), 'settings', 'email', $email);
2012-06-04 18:42:25 +00:00
OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
}else{
2012-06-04 18:42:25 +00:00
OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
}