| @@ 119-141 (lines=23) @@ | ||
| 116 | } |
|
| 117 | } |
|
| 118 | } |
|
| 119 | function validate_device_data($data){ |
|
| 120 | ||
| 121 | if(isset($data["username"]) && $data["username"] != ""){ |
|
| 122 | $db_config = Common_model::$global_config['system_config']; |
|
| 123 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
| 124 | $this->opensips_db = $this->load->database($opensipdsn, true); |
|
| 125 | $where = array("username"=>$data["username"]); |
|
| 126 | if($data['id'] != ""){ |
|
| 127 | $this->opensips_db->where("id <>",$data['id']); |
|
| 128 | } |
|
| 129 | $this->opensips_db->where($where); |
|
| 130 | $auth_flag = $this->opensips_db->get("subscriber"); |
|
| 131 | $auth_flag = $auth_flag->num_rows(); |
|
| 132 | if($auth_flag == 0){ |
|
| 133 | return "TRUE"; |
|
| 134 | }else{ |
|
| 135 | return array("username_error"=>"Duplicate Email Address Found Email Must Be Unique."); |
|
| 136 | } |
|
| 137 | }else{ |
|
| 138 | return array("username_error"=>"User name is required field."); |
|
| 139 | } |
|
| 140 | return "0"; |
|
| 141 | } |
|
| 142 | ||
| 143 | function user_opensips_save($user_flg = false) { |
|
| 144 | $array_add = $this->input->post(); |
|
| @@ 1752-1773 (lines=22) @@ | ||
| 1749 | } |
|
| 1750 | } |
|
| 1751 | } |
|
| 1752 | function validate_device_data($data){ |
|
| 1753 | if(isset($data["username"]) && $data["username"] != ""){ |
|
| 1754 | $db_config = Common_model::$global_config['system_config']; |
|
| 1755 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
|
| 1756 | $this->opensips_db = $this->load->database($opensipdsn, true); |
|
| 1757 | $where = array("username"=>$data["username"]); |
|
| 1758 | if($data['id'] != ""){ |
|
| 1759 | $this->opensips_db->where("id <>",$data['id']); |
|
| 1760 | } |
|
| 1761 | $this->opensips_db->where($where); |
|
| 1762 | $auth_flag = $this->opensips_db->get("subscriber"); |
|
| 1763 | $auth_flag = $auth_flag->num_rows(); |
|
| 1764 | if($auth_flag == 0){ |
|
| 1765 | return "TRUE"; |
|
| 1766 | }else{ |
|
| 1767 | return array("username_error"=>"Duplicate Username Found.Username Must be Unique"); |
|
| 1768 | } |
|
| 1769 | }else{ |
|
| 1770 | return array("username_error"=>"User name is required field."); |
|
| 1771 | } |
|
| 1772 | return "0"; |
|
| 1773 | } |
|
| 1774 | ||
| 1775 | function user_opensips_delete($id){ |
|
| 1776 | $this->user_model->user_opensips_delete($id); |
|