lostpassword.php 459 B

12345678910111213141516
  1. <?php
  2. OC_JSON::checkLoggedIn();
  3. OCP\JSON::callCheck();
  4. $l=OC_L10N::get('core');
  5. // Get data
  6. if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ) {
  7. $email=trim($_POST['email']);
  8. OC_Preferences::setValue(OC_User::getUser(), 'settings', 'email', $email);
  9. OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));
  10. }else{
  11. OC_JSON::error(array("data" => array( "message" => $l->t("Invalid email") )));
  12. }