2011-09-26 23:10:56 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
OC_JSON::checkLoggedIn();
|
2012-07-07 17:27:04 +04:00
|
|
|
OCP\JSON::callCheck();
|
2011-09-26 23:10:56 +04:00
|
|
|
|
2012-04-14 18:44:15 +04:00
|
|
|
$l=OC_L10N::get('core');
|
2011-09-26 23:10:56 +04:00
|
|
|
|
|
|
|
// Get data
|
2014-03-24 18:35:07 +04:00
|
|
|
if( isset( $_POST['email'] ) && OC_Mail::validateAddress($_POST['email']) ) {
|
2012-06-05 00:24:13 +04:00
|
|
|
$email=trim($_POST['email']);
|
2012-09-04 13:47:35 +04:00
|
|
|
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") )));
|
2011-09-26 23:10:56 +04:00
|
|
|
}else{
|
2012-06-04 22:42:25 +04:00
|
|
|
OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
|
2011-09-26 23:10:56 +04:00
|
|
|
}
|