Пример #1
0
 function saveConfig($config)
 {
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $configKeys = array_keys($config);
     $size = sizeof($configKeys);
     for ($index = 0; $index < $size; $index++) {
         if (get_magic_quotes_gpc()) {
             $key = stripslashes($configKeys[$index]);
             $text = stripslashes($config[$configKeys[$index]]);
         } else {
             $key = $configKeys[$index];
             $text = $config[$configKeys[$index]];
         }
         $key = stripslashes($key);
         $key = str_replace("'", "", $key);
         if ($key == 'token_new' && !empty($text)) {
             $key = 'token';
             $erro->ck = $this->update('license', '');
         }
         if ($key == 'license1') {
             $text = trim($text);
             $key = 'license';
         }
         if (isset($GLOBALS[ACA . $key]) and $GLOBALS[ACA . $key] != $text) {
             if ($key == 'token') {
                 $code = auto::getToken($text);
             }
             $erro->ck = $this->update($key, $text);
         }
         $erro->E(__LINE__, '9010', $config);
     }
     if (class_exists('auto')) {
         auto::good();
     }
     return $erro->R();
 }