ZenCart_Documentation  1.5.0
http://www.collinsharper.com
C:/xampp/htdocs/zen-cart/admin/includes/init_includes/init_errors.php
Go to the documentation of this file.
00001 <?php
00009 if (!defined('IS_ADMIN_FLAG')) {
00010   die('Illegal Access');
00011 }
00012 // check if a default currency is set
00013   if (!defined('DEFAULT_CURRENCY')) {
00014     $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
00015   }
00016 
00017 // check if a default language is set
00018   if (!defined('DEFAULT_LANGUAGE') || DEFAULT_LANGUAGE=='') {
00019     $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
00020   }
00021 
00022   if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
00023     $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
00024   }
00025 
00026 // set demo message
00027   if (zen_get_configuration_key_value('ADMIN_DEMO')=='1') {
00028     if (zen_admin_demo()) {
00029       $messageStack->add(ADMIN_DEMO_ACTIVE, 'warning');
00030     } else {
00031       $messageStack->add(ADMIN_DEMO_ACTIVE_EXCLUSION, 'warning');
00032     }
00033   }
00034 
00035   // check if email subsystem has been disabled
00036   if (SEND_EMAILS != 'true') {
00037     $messageStack->add(WARNING_EMAIL_SYSTEM_DISABLED, 'error');
00038   }
00039 
00040   // this will let the admin know that the website is DOWN FOR MAINTENANCE to the public
00041   if (DOWN_FOR_MAINTENANCE == 'true') {
00042     $messageStack->add(WARNING_ADMIN_DOWN_FOR_MAINTENANCE,'caution');
00043   }
00044 
00045 // include the password crypto functions
00046   require(DIR_WS_FUNCTIONS . 'password_funcs.php');
00047 
00048 // default admin settings
00049   $admin_security = false;
00050 
00051   $demo_check = $db->Execute("select * from " . TABLE_ADMIN . " where admin_name='demo' or admin_name='Admin'");
00052   if (!$demo_check->EOF) {
00053 
00054     $cnt_admin= 0;
00055     while (!$demo_check->EOF) {
00056       $checking = $demo_check->fields['admin_pass'];
00057       if (($demo_check->fields['admin_name'] =='Admin' and zen_validate_password('admin', $checking))) {
00058         $admin_security = true;
00059         $cnt_admin++;
00060       }
00061       if (($demo_check->fields['admin_name'] =='demo' and zen_validate_password('demoonly', $checking))) {
00062         $admin_security = true;
00063         $cnt_admin++;
00064       }
00065 
00066       $demo_check->MoveNext();
00067     }
00068 
00069     if ($admin_security == true) {
00070       $messageStack->add(ERROR_ADMIN_SECURITY_WARNING, 'caution');
00071     }
00072   }
00073 
00074   // log cleanup
00075   if ($za_dir = @dir(DIR_FS_SQL_CACHE)) {
00076     while ($zv_file = $za_dir->read()) {
00077       if (preg_match('/^zcInstall.*\.log$/', $zv_file)) {
00078         unlink(DIR_FS_SQL_CACHE . '/' . $zv_file);
00079       }
00080     }
00081     $za_dir->close();
00082     unset($za_dir);
00083   }
 All Data Structures Namespaces Files Functions Variables Enumerations