Example #1
0
$dob = $user_info['dob'];
$emailid = $user_info['emailid'];
$pass = $user_info['password'];
$user_insert_id = "";
//contains the city Ids, it will get us the location
//$cityid = $userManager->getuserLocation();
$cityid = '1';
//Inserting into the profecient Table;;
$LProfManager = new LanguageProfManager();
$User->setFirstName($userfname);
$User->setLastName($userlname);
$User->setLogin($userid);
$User->setEmail($emailid);
$User->setPassword($pass);
$User->setDOB($dob);
$User->setLocation($cityid);
$User->setRegistration_date(date("Y-m-d"));
$User->setUserType(4);
$user_insert_id = $userManager->addUser($User);
//echo $user_insert_id;
if ($user_insert_id) {
    //$cityid='4';
    $prof = [];
    $count_prof = count($user_info['mylanguage']);
    $i = 0;
    if (count($count_prof) > 0) {
        for ($i = 0; $i < $count_prof; $i++) {
            $lprof[] = new LanguageProf();
            $lprof[$i]->setLanguageId($user_info['mylanguage'][$i]);
            $lprof[$i]->setProf($user_info['proficient'][$i]);
            $lprof[$i]->setUserId($user_insert_id);
Example #2
0
 public function testgetAndSetLocation()
 {
     $this->user->setLocation('spain');
     $this->assertEquals('spain', $this->user->getLocation());
 }
Example #3
0
 private function getUser($selectResult)
 {
     $User = new User();
     $count = 0;
     while ($list = mysqli_fetch_assoc($selectResult)) {
         $User->setUserId($list['usr_user_id']);
         $User->setFirstName($list['usr_first_name']);
         $User->setLastName($list['usr_last_name']);
         $User->setLogin($list['usr_login']);
         //$User->setUserRatingId($list['']);
         $User->setEmail($list['usr_email']);
         $User->setDOB($list['usr_DOB']);
         $User->setLocation($list['usr_location_id']);
         $User->setRegistration_date($list['usr_registration_date']);
         $User->setUserType($list['usr_user_type_id']);
         $User->setUserLanguage($list['usr_language']);
         $User->setEmailSub($list['usr_email_subscribed']);
         $User->setMediaId($list['usr_media_id']);
     }
     // while
     return $User;
 }
Example #4
0
 // instantiate a User with this data
 $user = new User();
 // required fields
 $user->setUsername($uname);
 $user->setEmail($email);
 $user->setPassword($pw);
 $user->setDOB($dob);
 // optional fields
 if ($name != '') {
     $user->setName($name);
 }
 if ($sex != '') {
     $user->setSex($sex);
 }
 if ($location != '') {
     $user->setLocation($location);
 }
 if ($biography != '') {
     $user->setBiography($biography);
 }
 $user->save();
 // save the user
 $user->setLastLogin($user->getDateCreated());
 $user->save();
 // save last login as date created
 // log the event
 $logEvent = new Event(array('event_type_id' => 'create_user', 'user_1_id' => $user->getId()));
 $logEvent->save();
 // email confirmation
 $body = '<p>You have successfully registered for <a href="' . Url::base() . '">' . PIPELINE_NAME . '</a>.</p>';
 $body .= '<p>Your username is ' . formatUserLink($user->getID()) . '. Have fun!</p>';