diff --git a/core/install/upgrade_switch.php b/core/install/upgrade_switch.php new file mode 100644 index 0000000000..dc579b4a86 --- /dev/null +++ b/core/install/upgrade_switch.php @@ -0,0 +1,59 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2012 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ + +// set included, if not + if (!isset($included)) { $included = false; } + +//check the permission + if(defined('STDIN')) { + $document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]); + preg_match("/^(.*)\/core\/.*$/", $document_root, $matches); + $document_root = $matches[1]; + set_include_path($document_root); + require_once "resources/require.php"; + $_SERVER["DOCUMENT_ROOT"] = $document_root; + $format = 'text'; //html, text + } + else if (!$included) { + include "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + if (permission_exists('upgrade_switch') || if_group("superadmin")) { + //echo "access granted"; + } + else { + echo "access denied"; + exit; + } + $format = 'html'; //html, text + } + +//run switch upgrade + require_once "resources/classes/install_switch.php"; + $switch = new install_switch; + $switch->upgrade(); + +?> \ No newline at end of file diff --git a/core/upgrade/app_config.php b/core/upgrade/app_config.php index effd5308f4..55cc41a13b 100644 --- a/core/upgrade/app_config.php +++ b/core/upgrade/app_config.php @@ -32,6 +32,9 @@ $apps[$x]['permissions'][$y]['menu']['uuid'] = "e7bb1296-3141-48c9-a95a-82d2768d0ae4"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "upgrade_switch"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; //schema details $y = 0; //table array index diff --git a/core/upgrade/app_languages.php b/core/upgrade/app_languages.php index b7d735eced..3e28a8da98 100644 --- a/core/upgrade/app_languages.php +++ b/core/upgrade/app_languages.php @@ -180,6 +180,16 @@ $text['label-upgrade_apps']['sv-se'] = "App Standard"; $text['label-upgrade_apps']['uk'] = "Типові значення додатків"; $text['label-upgrade_apps']['de-at'] = "Applikationen zurücksetzen"; +$text['label-upgrade_switch']['en-us'] = "Switch Upgrade"; +$text['label-upgrade_switch']['es-cl'] = ""; +$text['label-upgrade_switch']['pt-pt'] = ""; +$text['label-upgrade_switch']['fr-fr'] = ""; +$text['label-upgrade_switch']['pt-br'] = ""; +$text['label-upgrade_switch']['pl'] = ""; +$text['label-upgrade_switch']['sv-se'] = ""; +$text['label-upgrade_switch']['uk'] = ""; +$text['label-upgrade_switch']['de-at'] = ""; + $text['label-upgrade']['en-us'] = "Upgrade"; $text['label-upgrade']['es-cl'] = "Actualizar"; $text['label-upgrade']['pt-pt'] = "Actualizar"; @@ -390,6 +400,16 @@ $text['description-upgrade_apps']['sv-se'] = "Återställer standardinställning $text['description-upgrade_apps']['uk'] = "Встановлює типові значення для додатків"; $text['description-upgrade_apps']['de-at'] = "Setzt alle Applikationen auf die Standardeinstellungen zurück."; +$text['description-upgrade_switch']['en-us'] = "Runs the upgrade switch routine."; +$text['description-upgrade_switch']['es-cl'] = ""; +$text['description-upgrade_switch']['pt-pt'] = ""; +$text['description-upgrade_switch']['fr-fr'] = ""; +$text['description-upgrade_switch']['pt-br'] = ""; +$text['description-upgrade_switch']['pl'] = ""; +$text['description-upgrade_switch']['sv-se'] = ""; +$text['description-upgrade_switch']['uk'] = ""; +$text['description-upgrade_switch']['de-at'] = ""; + $text['description-upgrade']['en-us'] = "Select the actions below you wish to perform."; $text['description-upgrade']['es-cl'] = "Seleccione las acciones a continuación que desea realizar."; $text['description-upgrade']['pt-pt'] = "Selecione as ações abaixo você deseja executar."; diff --git a/core/upgrade/index.php b/core/upgrade/index.php index 6a83f51e10..d51b012718 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -35,6 +35,7 @@ if ( !permission_exists('upgrade_source') && !permission_exists('upgrade_schema') && !permission_exists('upgrade_apps') && + !permission_exists('upgrade_switch') && !permission_exists('menu_restore') && !permission_exists('group_edit') ) { @@ -121,6 +122,13 @@ if (sizeof($_POST) > 0) { $response_message = "Permission Defaults Restored"; } + // upgrade switch + if ($do["switch"] && permission_exists("upgrade_switch")) { + $included = true; + require_once("core/install/upgrade_switch.php"); + $response_message = "Switch Upgraded"; + } + if (sizeof($_POST['do']) > 1) { $response_message = $text['message-upgrade']; } @@ -250,6 +258,22 @@ if (permission_exists("group_edit")) { echo "\n"; } +if (permission_exists("upgrade_switch")) { + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "
\n"; + echo " ".$text['label-upgrade_switch']; + echo " \n"; + echo " \n"; + echo "
\n"; +} + echo "
"; echo "
"; echo "

";