- } elseif ($task_found == "0") {
- // No longer assigned or old task
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_ASSIGED);
- } else {
- // ID is invalid
- LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_REG_FAILED_INVALID);
- }
- break;
-
-case "search": // Search for new extensions on our server
- // Get response from our server
- $response = MXCHANGE_OPEN("extensions.php");
-
- // Are extensions found?
- if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
- {
- // Ok, mark found and create the array
- $EXT_SEARCH = array(
- 'fname' => array(), // File names
- 'fsize' => array(), // File size
- 'fctime' => array(), // File creation timestamp
- 'infos' => array(), // File informations (maybe loaded!)
- 'ver' => array(), // Version number
- 'cver' => array(), // Current version number
- );
-
- // Get count of extensions for validation
- $count = trim($response[sizeof($response) - 2]);
- foreach ($response as $id=>$value)
- {
- $value = str_replace("\n", "", $value); $ver = "";
- // Leave loop when data is invalid or EOF?
- if ((substr($value, 0, 4) == "ext-") && (substr($value, -4) == ".zip"))
- {
- $name = substr($value, 4, -4);
- $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $name);
- $ver = trim(substr($response[$id + 3], 4));
-
- // Load current extension's version
- $cver = GET_EXT_VERSION($name);
- if (empty($cver)) $cver = "-.-";
-
- // Is the extension already installed or not?
- if (!file_exists($file) || ($ver != $cver))
- {
- // No, it isn't. So let's add this one!
- $EXT_SEARCH['fname'][] = $name;
- $EXT_SEARCH['fsize'][] = $response[$id + 1];
- $EXT_SEARCH['fctime'][] = $response[$id + 2];
- $EXT_SEARCH['ver'][] = $ver;
- $EXT_SEARCH['cver'][] = $cver;
-
- $LANG_DUMMY = explode("[nl]", $response[$id + 4]);
- $LANG = array();
- $INFO = ADMIN_EXT_NO_INFO_FOUND;
-
- // Trim every data line
- foreach ($LANG_DUMMY as $k=>$v)
- {
- $v = trim($v);
- if (substr($v, 3) == "") $v = "---";
- $LANG_DUMMY[$k] = $v;
- if ($v == "xx:xx") break;
- $LANG[] = $v;
- }