php - Login with email on codeigniter from database -


i'm building api, need login in codeigniter-restserver project email + password stored on mysql database.

this tried far:

in rest_controller changed _check_login function this:

$this->load->model('model_logiin'); $valid_logins = $this->model_logiin->get_by(array('student_id'=>$username)); 

please take @ complete code here : https://github.com/chriskacerguis/codeigniter-restserver

model model_logiin this:

class model_logiin extends my_model{  protected $_table = 'students'; protected $primary_key = 'email_adress'; protected $return_type = 'array';  protected $after_get = array('remove_sensetive_data');   //specified in my_model class  protected function remove_sensetive_data($student){      unset($student['ip_adress']);     unset($student['student_id']);     ...      return $student; } } 

the problem: in login stage.. if type can login

** if need more info please let me know

** if best approach api not login email api-key please let me know

** i'm new codeigniter.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -