nextcloud/settings/ajax/lostpassword.php

16 lines
464 B
PHP
Raw Normal View History

<?php
OC_JSON::checkLoggedIn();
2012-07-07 17:27:04 +04:00
OCP\JSON::callCheck();
2014-08-31 12:05:59 +04:00
$l = \OC::$server->getL10N('settings');
// Get data
if( isset( $_POST['email'] ) && OC_Mail::validateAddress($_POST['email']) ) {
2012-06-05 00:24:13 +04:00
$email=trim($_POST['email']);
OC_Preferences::setValue(OC_User::getUser(), 'settings', 'email', $email);
2012-06-04 22:42:25 +04:00
OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
}else{
2012-06-04 22:42:25 +04:00
OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
}