2011-09-26 19:10:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Init owncloud
|
2012-09-04 09:47:35 +00:00
|
|
|
require_once '../../lib/base.php';
|
2011-09-26 19:10:56 +00:00
|
|
|
OC_JSON::checkLoggedIn();
|
2012-07-07 13:27:04 +00:00
|
|
|
OCP\JSON::callCheck();
|
2011-09-26 19:10:56 +00:00
|
|
|
|
2012-04-14 14:44:15 +00:00
|
|
|
$l=OC_L10N::get('core');
|
2011-09-26 19:10:56 +00:00
|
|
|
|
|
|
|
// Get data
|
2012-09-04 09:47:35 +00:00
|
|
|
if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ) {
|
2012-06-04 20:24:13 +00:00
|
|
|
$email=trim($_POST['email']);
|
2012-09-04 09:47:35 +00:00
|
|
|
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") )));
|
2011-09-26 19:10:56 +00:00
|
|
|
}else{
|
2012-06-04 18:42:25 +00:00
|
|
|
OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
|
2011-09-26 19:10:56 +00:00
|
|
|
}
|