//print_r( $employee ); //die; if ($employee->is_active == "Y") { $session->message("<div class='error'>" . format_lang('errormsg', 60) . "</div>"); redirect_to(BASE_URL . "login/"); exit; } else { // if found //echo sizeof($employee); //die; if ($employee) { $reg_email = $employee->email_address; $reg_key = $employee->actkey; $username = $employee->username; // generate the verication code $reg_pass = $new_pass = create_new_password(); $password_change = Employee::change_password($username, $new_pass); if ($password_change) { $email_template = get_lang('email_template', 'employee_signup'); $subject = str_replace("#SiteName#", SITE_NAME, $email_template['email_subject']); $body = $email_template['email_text']; if (REG_CONFIRMATION == "N") { //reg_key $reg_confirmation = $lang['email_template']['reg_confirmation']; $body = str_replace("#Message#", $reg_confirmation, $body); } $body = str_replace("#Password#", $reg_pass, $body); $body = str_replace("#Link#", BASE_URL, $body); $body = str_replace("#FullName#", $employee->full_name(), $body); $body = str_replace("#UserId#", $employee->username, $body); $body = str_replace("#Domain#", $_SERVER['HTTP_HOST'], $body);
//"http://jobberland.com/demo/facebook/index.php"; die; //if user is logged in and session is valid. if ($fbme) { //Calling users.getinfo legacy api call example try { $param = array('method' => 'users.getinfo', 'uids' => $fbme['id'], 'fields' => 'id, email, first_name, last_name, name, current_location, profile_url', 'callback' => ''); $userInfo = $facebook->api($param); foreach ($userInfo as $key => $data) { $first_name = $data['first_name']; $last_name = $data['last_name']; $email = $data['email']; $id = $data['id']; } die; $pass = create_new_password(); $employee = new Employee(); $employee->terms = 1; $username = explode("@", $email); $employee->username = $username[0]; $employee->email_address = $email; $employee->passwd = $pass; $employee->confirm_passwd = $pass; $employee->fname = $first_name; $employee->sname = $last_name; $employee->country = "UK"; $employee->employee_status = "active"; $employee->is_active = "Y"; $employee->extra_id = "facebook_" . $id; if ($employee->save()) { $user_id = $db->insert_id();