Subversion Repositories oidplus

Rev

Rev 1293 | Rev 1422 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1293 Rev 1375
Line 152... Line 152...
152
 
152
 
153
                        if ($update_version == 1) {
153
                        if ($update_version == 1) {
154
                                // Now call the written file
154
                                // Now call the written file
155
                                // Note: we may not use eval($cont) because the script uses die(),
155
                                // Note: we may not use eval($cont) because the script uses die(),
156
                                // and things in the script might collide with currently (un)loaded source code files, shutdown procedues, etc.
156
                                // and things in the script might collide with currently (un)loaded source code files, shutdown procedues, etc.
-
 
157
                                $web_file = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL).$tmp_filename;
-
 
158
                                $res = url_get_contents($web_file);
-
 
159
                                if ($res === false) {
157
                                $web_file = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE).$tmp_filename; // NOT canonical URL! This might fail with reverse proxies which can only be executed from outside
160
                                        $web_file = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE).$tmp_filename;
158
                                $res = url_get_contents($web_file);
161
                                        $res = url_get_contents($web_file);
159
                                if ($res === false) {
162
                                        if ($res === false) {
160
                                        throw new OIDplusException(_L('Update-script %1 could not be executed',$web_file));
163
                                                throw new OIDplusException(_L('Update-script %1 could not be executed',$web_file));
161
                                }
164
                                        }
-
 
165
                                }
162
                                return array("status" => 0, "content" => $res, "rev" => $rev);
166
                                return array("status" => 0, "content" => $res, "rev" => $rev);
163
                        } else if ($update_version == 2) {
167
                        } else if ($update_version == 2) {
164
                                // In this version, the client will call the web-update file.
168
                                // In this version, the client will call the web-update file.
165
                                // This has the advantage that it will also work if the system is htpasswd protected
169
                                // This has the advantage that it will also work if the system is htpasswd protected
166
                                return array("status" => 0, "update_file" => $tmp_filename, "rev" => $rev);
170
                                return array("status" => 0, "update_file" => $tmp_filename, "rev" => $rev);