/**
  * Email Setter function
  *
  * @author Ruchi Kothari
  *
  * @param string $_email email address of user
  *
  * @return bool "true" on Success, "false" otherwise
  * @throws SWIFT_User_Exception If email address is invalid
  */
 public function SetEmail($_email)
 {
     if (trim($_email) == '' || !IsEmailValid($_email)) {
         throw new SWIFT_User_Exception("Invalid Email Address: " . SWIFT_INVALIDDATA);
         return false;
     }
     $this->_email = trim($_email);
     return true;
 }
 /**
  * Checks new application submit
  *
  * @author Atul Atri
  * @return bool "true" on Success, "false" otherwise
  */
 private function CheckNewAppSubmit()
 {
     $_SWIFT = SWIFT::GetInstance();
     if (!SWIFT_Session::CheckCSRFHash($_POST['csrfhash'])) {
         SWIFT::Error($_SWIFT->Language->Get('titlecsrfhash'), $_SWIFT->Language->Get('msgcsrfhash'));
         return false;
     }
     $_appName = trim($_POST['bc_app_name']);
     $_appEmail = trim($_POST['bc_app_email']);
     $_appId = trim($_POST['bc_app_id']);
     $_appSecret = trim($_POST['bc_app_secret']);
     if (empty($_appName)) {
         $this->UserInterface->CheckFields('bc_app_name');
         $this->UserInterface->Error($this->Language->Get('basecamp_error_title'), $this->Language->Get('empty_bc_app_name'));
         return false;
     }
     if (empty($_appEmail)) {
         $this->UserInterface->CheckFields('bc_app_email');
         $this->UserInterface->Error($this->Language->Get('basecamp_error_title'), $this->Language->Get('empty_bc_app_email'));
         return false;
     }
     if (!IsEmailValid($_appEmail)) {
         $this->UserInterface->CheckFields('bc_app_email');
         $this->UserInterface->Error($this->Language->Get('basecamp_error_title'), $this->Language->Get('invalid_bc_app_email'));
         return false;
     }
     if (empty($_appId)) {
         $this->UserInterface->CheckFields('bc_app_id');
         $this->UserInterface->Error($this->Language->Get('basecamp_error_title'), $this->Language->Get('empty_bc_app_id'));
         return false;
     }
     if (empty($_appSecret)) {
         $this->UserInterface->CheckFields('bc_app_secret');
         $this->UserInterface->Error($this->Language->Get('basecamp_error_title'), $this->Language->Get('empty_bc_app_secret'));
         return false;
     }
     return true;
 }