Passed
Branch master (7ed08e)
by IRFA
01:58
created
libraries/Auth.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
 		$this->CI = & get_instance();
14 14
 	}
15 15
 	/**
16
-     * Cek username dan password, jika password yang diinputkan sama dengan di database sama maka login sukses.
17
-     *
18
-     * @param string $username
19
-     * @param string $password
20
-     * @return boolean
21
-     */
16
+	 * Cek username dan password, jika password yang diinputkan sama dengan di database sama maka login sukses.
17
+	 *
18
+	 * @param string $username
19
+	 * @param string $password
20
+	 * @return boolean
21
+	 */
22 22
 	public function verify($username,$password){
23 23
 		$get = $this->CI->user->getBy(['username' => $username]);
24 24
 		if(password_verify($password, $get->password)) {
25 25
 			$user_datas = array(
26
-			        'user_id'  => $get->id,
27
-			        'logged_in' => TRUE,
28
-			        'login_token' => sha1($get->id.time().mt_rand(1000,9999))
26
+					'user_id'  => $get->id,
27
+					'logged_in' => TRUE,
28
+					'login_token' => sha1($get->id.time().mt_rand(1000,9999))
29 29
 			);
30 30
 			$this->CI->session->sess_regenerate();
31 31
 			$this->CI->session->set_userdata($user_datas);
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 		}
37 37
 	}
38 38
 	/**
39
-     * Cek sudah login apa belum.
40
-     *
41
-     * @return boolean
42
-     */
39
+	 * Cek sudah login apa belum.
40
+	 *
41
+	 * @return boolean
42
+	 */
43 43
 	public function check(){
44 44
 		if($this->CI->session->logged_in) {
45 45
 			return true;
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	/**
52
-     * Ambil data user sesuai dengan id yang login.
53
-     *
54
-     * @return mixed
55
-     */
52
+	 * Ambil data user sesuai dengan id yang login.
53
+	 *
54
+	 * @return mixed
55
+	 */
56 56
 	public function user(){
57 57
 		if($this->check()) {
58 58
 			$get = $this->CI->user->getBy(['id' => $this->CI->session->user_id]);
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 
65 65
 	/**
66
-     * Keluar dari sesi.
67
-     *
68
-     * @return void
69
-     */
66
+	 * Keluar dari sesi.
67
+	 *
68
+	 * @return void
69
+	 */
70 70
 	public function logout(){
71 71
 		if(empty($this->CI->input->get('token'))){
72 72
 			return redirect($_SERVER['HTTP_REFERER']);
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
 		return redirect(base_url('login'));
86 86
 	}
87 87
 	/** 
88
-	* Mencegah guest untuk mengakses halaman
89
-	* @return void
90
-	*/
88
+	 * Mencegah guest untuk mengakses halaman
89
+	 * @return void
90
+	 */
91 91
 	public function protect(){
92 92
 		if(!$this->check()){
93 93
 			$this->destroy();
Please login to merge, or discard this patch.