示例#1
0
         $app->addError("El correo electrónico indicado ya está en uso.");
         $app->getInput()->save();
         //flash form data
         $app->redirect($app->getHelper('UrlHelper')->getUrl('editarPerfil'));
         return;
     }
     $validNewEmail = true;
 }
 // Update user info
 $dataUser = array('name' => $name, 'lastname' => $lastname, 'dob' => $dob);
 if ($validNewPass) {
     $dataUser['password'] = $newPass;
 }
 if ($validNewEmail) {
     $dataUser['new_email'] = $email;
     $dataUser['new_email_code'] = StringHelper::generateRandomString();
 }
 $user = User::updateUser($currentUser->id, $dataUser);
 // Update detail user info
 $dataProfile = array(UserDetail::USER_DETAIL_DESCRIPTION => $desc, UserDetail::USER_DETAIL_ADDRESS => $direccion, UserDetail::USER_DETAIL_ZIP_CODE => $cp, UserDetail::USER_DETAIL_COUNTRY => $pais, UserDetail::USER_DETAIL_PHONE => $tel, UserDetail::USER_DETAIL_CITY => $city, UserDetail::USER_DETAIL_MOBILE_PHONE => $movil);
 $folder_id = sha1($currentUser->id);
 $dir = "../profiles/" . $folder_id;
 //si es fotografo
 if ($userType == User::USER_TYPE_PHOTOGRAPHER) {
     $camaraArray = $_REQUEST['user_camara'];
     $lentesArray = $_REQUEST['user_lentes'];
     $equipoArray = $_REQUEST['user_equipo'];
     $escuelaFotografia = $_REQUEST['user_escuela_fotografia'];
     $masEducacion = $_REQUEST['user_mas_educacion'];
     $experienciaLaboralEmpresa = $_REQUEST['user_experience_empresa'];
     $experienciaLaboralUbicacion = $_REQUEST['user_experience_localidad'];
示例#2
0
} else {
    if ($g == "female") {
        $gender = "M";
    }
}
$user_name = utf8_decode($data['first_name']);
$user_lastname = utf8_decode($data['last_name']);
$user_gender = $gender;
$user_email = $data['email'];
$user_pass = sha1($data['password']);
$user_dob = $bday[2] . "-" . $bday[0] . "-" . $bday[1];
$user_type = $data['user_type'];
$user_salt = salt();
// TODO: ESTA FUNCION SE MIGRO AL MODELO DE USER
$user_act = "N";
$user_act_code = StringHelper::generateRandomString();
$passEnc = sha1($user_salt . $user_pass);
$reg = listAll("user", "WHERE user = '******'");
$reg_num = mysql_num_rows($reg);
if ($reg_num < 1) {
    $user_insert = insertTable("user", "'','{$user_name}','{$user_lastname}','{$user_dob}','{$user_gender}','{$user_email}','{$passEnc}','{$user_salt}','{$user_type}',NOW(),'0000-00-00 00:00:00','{$user_act}','{$user_act_code}', false, false");
    if ($user_insert > 0) {
        $to = $user_email;
        $toName = $user_name . ' ' . $user_lastname;
        $asunto = "Confirmación de registro";
        $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'confirmacion_url' => FConfig::getUrl('confirmacion') . '?c=' . $user_act_code . '&e=' . $user_email);
        $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/registroEmail.html'));
        $mailer = new FMailer();
        $receivers = array(array('email' => $to, 'name' => $toName));
        $mailer->setReceivers($receivers);
        $mailer->sendEmail($asunto, $body);
示例#3
0
文件: App.php 项目: narbelys/fototea
 public function addError($message, $params = array())
 {
     if (!empty($params)) {
         $message = StringHelper::replaceParams($message, $params);
     }
     $this->getSession()->flash('error', $message);
 }
示例#4
0
文件: User.php 项目: narbelys/fototea
 public static function create($name, $lastName, $email, $password, $userType)
 {
     $userSalt = self::generateSalt();
     $userPass = self::generatePass($password, $userSalt);
     $user = ORM::for_table(self::$table)->create();
     $user->name = $name;
     $user->lastname = $lastName;
     $user->dob = '0000-00-00 00:00:00';
     $user->user = $email;
     $user->password = $userPass;
     $user->salt = $userSalt;
     $user->user_type = $userType;
     $user->set_expr('cdate', 'NOW()');
     $user->last_login = '******';
     // TODO: PENSAR SI DEJAR ASI
     $user->act = self::USER_STATUS_INACTIVE;
     $user->act_code = StringHelper::generateRandomString();
     if ($userType == self::USER_TYPE_PHOTOGRAPHER) {
         $user->profile_completed = self::USER_PHOTOGRAPHER_UNCOMPLETED_PROFILE;
     } else {
         $user->profile_completed = self::USER_CLIENT_UNCOMPLETED_PROFILE;
     }
     $user->save();
     return $user;
 }