Code Duplication    Length = 15-15 lines in 2 locations

dashboard/application/core/MY_Controller.php 2 locations

@@ 108-122 (lines=15) @@
105
106
                                $this->session->set_userdata('last_url', current_url());
107
                                redirect('http://'.$_SERVER['HTTP_HOST'].'/dashboard/authentication/external-login');
108
                            } else {
109
110
                                $uid = $this->user_model->get_uid_from_username($username);
111
                                $this->user_model->set_user($uid, $username, $ip);
112
                                $this->user_model->external_login_reset($uid);
113
                                // reset as internal
114
115
                                $this->session->set_userdata('username', $username);
116
                                $this->session->set_userdata('uid', $uid);
117
                                $this->session->set_userdata('ldap', $user_ldap);
118
                                $this->session->set_userdata('is_private', $is_private);
119
                                
120
                                //uses sessions
121
                                $this->user_model->user_log();
122
                            }
123
                        } else {
124
125
                            $uid = $this->user_model->get_uid_from_username($username);
@@ 123-137 (lines=15) @@
120
                                //uses sessions
121
                                $this->user_model->user_log();
122
                            }
123
                        } else {
124
125
                            $uid = $this->user_model->get_uid_from_username($username);
126
                            $this->user_model->set_user($uid, $username, $ip);
127
                            $this->user_model->external_login_reset($uid);
128
                            // reset as internal
129
130
                            $this->session->set_userdata('username', $username);
131
                            $this->session->set_userdata('uid', $uid);
132
                            $this->session->set_userdata('ldap', $user_ldap);
133
                            $this->session->set_userdata('is_private', $is_private);
134
                            
135
                            //uses sessions
136
                            $this->user_model->user_log();
137
                        }
138
                    }
139
                }
140
            }