コード例 #1
0
ファイル: users.php プロジェクト: laiello/mysvntrac
 function add()
 {
     $data = array('title' => 'Add User', 'view' => 'users_add');
     $this->load->helper(array('form'));
     $this->load->library('form_validation');
     $this->form_validation->set_rules('username', 'Username', 'trim|required|alpha_dash');
     $this->form_validation->set_rules('password', 'Password', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $this->load->view('template', $data);
     } else {
         htpasswd_add($this->config->item('htpasswd_file'), $this->input->post('username'), $this->input->post('password'));
         redirect('users');
     }
 }
コード例 #2
0
ファイル: hooks.php プロジェクト: ninetian/omk-server
 public function users_add($user)
 {
     htpasswd_add(__DIR__ . '/htpasswd.users', $user['email'], crypt($user['pass']));
 }