nextcloud/settings/ajax/lostpassword.php

20 lines
490 B
PHP
Raw Normal View History

<?php
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkLoggedIn();
2012-04-14 18:44:15 +04:00
$l=OC_L10N::get('core');
// Get data
2012-06-05 00:24:13 +04:00
if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ){
$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") )));
}
2012-06-05 00:24:13 +04:00
?>