Changeset 19225 for events/phpframework
- Timestamp:
- 09/12/08 17:55:02 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/controllers/signup.php
r19194 r19225 12 12 function index() 13 13 { 14 $this->load->database(); 14 15 $this->load->library('validation'); 15 $this->validation->set_error_delimiters('< font color="red">', '</font>');16 $this->validation->set_error_delimiters('<div class="red">', '</div>'); 16 17 17 18 // Required Field Rules. 18 $rules['username'] = "trim|required| min_length[3]|max_length[100]";19 $rules['username'] = "trim|required|alpha_dash|min_length[3]|max_length[100]|callback_check_username"; 19 20 $rules['password'] = "trim|required|alpha_numeric|min_length[6]|max_length[64]|matches[password2]"; 20 21 $rules['password2'] = "trim|required|alpha_numeric|min_length[6]|max_length[64]"; 21 $rules['email'] = "trim|required|valid_email|max_length[255] ";22 $rules['email'] = "trim|required|valid_email|max_length[255]|callback_check_email"; 22 23 //$rules['question'] = "required|max_lenght[80]"; 23 24 //$rules['answer'] = "required|max_lenght[40]"; … … 96 97 } 97 98 99 function check_username($username) 100 { 101 $this->db->select('id'); 102 $query = $this->db->get_where('users', array('username' => $username)); 103 104 if ($query->num_rows() > 0) 105 { 106 $this->validation->set_message('check_username', '%s はすでに登録されています。'); 107 return FALSE; 108 } 109 else 110 { 111 return TRUE; 112 } 113 } 114 115 function check_email($email) 116 { 117 $this->db->select('id'); 118 $query = $this->db->get_where('users', array('email' => $email)); 119 120 if ($query->num_rows() > 0) 121 { 122 $this->validation->set_message('check_email', '%s はすでに登録されています。'); 123 return FALSE; 124 } 125 else 126 { 127 return TRUE; 128 } 129 } 130 98 131 function activate($code = '') 99 132 {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)