Blame view

sources/settings/ajax/lostpassword.php 453 Bytes
03e52840d   Kload   Init
1
2
3
4
  <?php
  
  OC_JSON::checkLoggedIn();
  OCP\JSON::callCheck();
6d9380f96   Cédric Dupont   Update sources OC...
5
  $l=OC_L10N::get('settings');
03e52840d   Kload   Init
6
7
  
  // Get data
6d9380f96   Cédric Dupont   Update sources OC...
8
  if( isset( $_POST['email'] ) && OC_Mail::validateAddress($_POST['email']) ) {
03e52840d   Kload   Init
9
10
11
12
13
14
  	$email=trim($_POST['email']);
  	OC_Preferences::setValue(OC_User::getUser(), 'settings', 'email', $email);
  	OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
  }else{
  	OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
  }