if (typeof init_func === 'function') { init_func(); } } }); } var iMeetPageTitle = "<?php echo my_page_title('page_iMeet_title'); ?> "; function iMeet_page_init() { iMeetPageTitle = "<?php echo my_page_title('page_iMeet_title'); ?> "; iMeet_page = true; if ($('#person-popup-empty').length == 0) { $('#show_person').modal('show'); } $('.person-ajax a, a.person-ajax').click(function(e) { ajaxPersonClick(e, this, true); }); $('#add-person-form').click(function(e) { href = $(this).attr('href');
/** * 10. Change password during password recovery */ public function recover_password($action = '') { if ($this->session->userdata('password_recovery') && !$this->session->userdata('logged_in')) { $user_id = $this->session->userdata('recover_user_id'); switch ($action) { case '': $this->load->view('includes/view_template', array('content' => 'recover_password', 'title' => my_page_title('page_recover_password_title'), 'user_id' => $user_id)); break; case 'validate': /********* recently added ************/ $this->form_validation->set_rules('password', my_lang('form_password_password_field'), 'required|matches[c_password]|trim|xss_clean'); $this->form_validation->set_rules('c_password', my_lang('form_password_c_password_field'), 'required|trim|xss_clean'); if ($this->form_validation->run()) { $password = $this->input->post('password'); $this->load->model('model_users'); $ok = $this->model_users->update_user_password($user_id, $password); if ($ok) { // logging user in $user = $this->model_users->get_user($user_id); if ($user) { $this->session->set_userdata($user); $this->session->set_userdata('logged_in', true); $this->session->set_userdata('has_account', true); $this->session->set_flashdata('success', my_lang('msg_success_new_passwd_set')); redirect('/'); } else { $this->session->set_flashdata('error', my_lang('msg_error_passwd_set_cant_login')); redirect('/Login'); } } else { // echo "can't update password"; $this->session->set_flashdata('error', my_lang('msg_error_cant_set_passwd')); redirect('/login/recover_password/'); } } else { // validation errors will be shown $this->recover_password(); } /********* recently added ************/ break; default: redirect('/'); } } else { if ($this->session->userdata('logged_in')) { redirect('/'); } else { redirect('/login'); } } }
/** * 4. Shows public user profile by any social network username * @param type $social_network * @param type $username */ public function social($social_network, $username = '') { if ($username) { $current_user_id = $this->session->userdata('id'); $this->load->model('model_users'); $user = $this->model_users->get_any_user($current_user_id, $username, true, $social_network); if ($user) { if ($user->id == $current_user_id) { $this->load->view('includes/view_template', array('user' => $user, 'content' => 'profile', 'title' => my_page_title('page_myProfile_title'))); } else { $this->load->view('includes/view_template', array('user' => $user, 'content' => 'user', 'title' => isset($user->reason) ? my_page_title('page_meetMe_user_title', $user->fullname) : my_page_title('page_user_title', $user->fullname), 'public' => true)); } } else { // no such user, maybe should show the user of the social network instead redirect('/'); } } else { redirect('/'); } }
/** * 12. Shows form to change user password (view_change_password.php via view_template.php) */ private function change_password_form() { // // show change password form $this->load->view('includes/view_template', array('content' => 'change_password', 'title' => my_page_title('page_myProfile_change_passwd_title'))); }