|
1 | 1 | <?php
|
| 2 | + |
2 | 3 | /* For licensing terms, see /license.txt */
|
3 |
| -/** |
4 |
| - * @package chamilo.webservices |
5 |
| - */ |
| 4 | + |
6 | 5 | ini_set('log_errors_max_len', 0);
|
7 | 6 | ini_set('soap.wsdl_cache_enabled', '0');
|
8 | 7 | ini_set('soap.wsdl_cache_ttl', '0');
|
|
16 | 15 |
|
17 | 16 | require_once $libpath.'nusoap/class.nusoap_base.php';
|
18 | 17 | require_once api_get_path(SYS_PLUGIN_PATH).'sepe/src/wsse/soap-server-wsse.php';
|
19 |
| -//require_once api_get_path(SYS_PLUGIN_PATH).'sepe/src/wsse/soap-wsse.php'; |
20 | 18 |
|
21 | 19 | $ns = api_get_path(WEB_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
|
22 | 20 | $wsdl = api_get_path(SYS_PLUGIN_PATH)."sepe/ws/ProveedorCentroTFWS.wsdl";
|
@@ -90,24 +88,24 @@ function authenticate($WSUser, $WSKey)
|
90 | 88 | $tUser = Database::get_main_table(TABLE_MAIN_USER);
|
91 | 89 | $tApi = Database::get_main_table(TABLE_MAIN_USER_API_KEY);
|
92 | 90 | $login = Database::escape_string($WSUser);
|
93 |
| - $sql = "SELECT u.user_id, u.status FROM $tUser u, $tApi a |
94 |
| - WHERE |
95 |
| - u.username='".$login."' AND |
96 |
| - u.user_id = a.user_id AND |
97 |
| - a.api_service = 'dokeos' AND |
| 91 | + $WSKey = Database::escape_string($WSKey); |
| 92 | + |
| 93 | + $sql = "SELECT u.user_id, u.status FROM $tUser u, $tApi a |
| 94 | + WHERE |
| 95 | + u.username='".$login."' AND |
| 96 | + u.user_id = a.user_id AND |
| 97 | + a.api_service = 'dokeos' AND |
98 | 98 | a.api_key='".$WSKey."'";
|
99 | 99 | $result = Database::query($sql);
|
100 | 100 |
|
101 | 101 | if (Database::num_rows($result) > 0) {
|
102 | 102 | $row = Database::fetch_row($result);
|
103 |
| - if ($row[1] == '4') { //UserManager::is_admin($row[0])) { |
| 103 | + if ($row[1] == '4') { |
104 | 104 | return true;
|
105 |
| - } else { |
106 |
| - return false; |
107 | 105 | }
|
108 |
| - } else { |
109 |
| - return false; |
110 | 106 | }
|
| 107 | + |
| 108 | + return false; |
111 | 109 | }
|
112 | 110 |
|
113 | 111 | $doc = new DOMDocument();
|
|
0 commit comments