From ec3f744e23fa07132d0c5f435f1f4d75b8d5c481 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Oct 2008 16:14:52 +0000 Subject: [PATCH] A lot naming conventions applied: - All action templates and classes now contains the application name - This is needed for the admin area where we need to add special filters for user rights validation - Class "BaseApplication" added which registers the ApplicationHelper class for later usage. - Some minor fixes --- .gitattributes | 53 ++++++++-------- application/admin/class_ApplicationHelper.php | 6 +- ...gout.ctp => action_admin_login_logout.ctp} | 0 ...ile.ctp => action_admin_login_profile.ctp} | 0 ... => action_admin_login_status_problem.ctp} | 0 .../de/code/action_admin_login_welcome.ctp | 13 ++++ .../de/code/action_admin_status_problem.ctp | 61 +++++++++++++++++++ .../de/code/action_login_welcome.ctp | 3 - .../admin/templates/de/code/login_main.ctp | 4 +- application/blog/class_ApplicationHelper.php | 6 +- ...ogout.ctp => action_blog_login_logout.ctp} | 0 ...file.ctp => action_blog_login_profile.ctp} | 0 ...p => action_blog_login_status_problem.ctp} | 0 ...come.ctp => action_blog_login_welcome.ctp} | 0 .../selector/class_ApplicationHelper.php | 6 +- .../ship-simu/class_ApplicationHelper.php | 6 +- application/ship-simu/config.php | 4 +- .../ship-simu/class_ShipSimuProfileAction.php | 3 +- ...{class_WebLogin => class_WebShipSimuLogin} | 6 +- ...> class_WebShipSimuLoginCompanyAction.php} | 6 +- ...=> class_WebShipSimuLoginRefillAction.php} | 6 +- ...ctp => action_ship_simu_login_company.ctp} | 0 ....ctp => action_ship_simu_login_logout.ctp} | 0 ...ctp => action_ship_simu_login_profile.ctp} | 0 ....ctp => action_ship_simu_login_refill.ctp} | 0 ...action_ship_simu_login_status_problem.ctp} | 0 ...ctp => action_ship_simu_login_welcome.ctp} | 0 .../shoutbox/class_ApplicationHelper.php | 6 +- ...t.ctp => action_shoutbox_login_logout.ctp} | 0 ....ctp => action_shoutbox_login_profile.ctp} | 0 ... action_shoutbox_login_status_problem.ctp} | 0 ....ctp => action_shoutbox_login_welcome.ctp} | 0 application/todo/class_ApplicationHelper.php | 6 +- ...ogout.ctp => action_todo_login_logout.ctp} | 0 ...file.ctp => action_todo_login_profile.ctp} | 0 ...p => action_todo_login_status_problem.ctp} | 0 ...come.ctp => action_todo_login_welcome.ctp} | 0 inc/classes/main/application/.htaccess | 1 + .../application/class_BaseApplication.php | 48 +++++++++++++++ .../web/class_WebLoginAreaCommand.php | 16 ++++- .../helper/web/links/class_WebLinkHelper.php | 3 + .../action/class_BaseActionResolver.php | 2 +- 42 files changed, 190 insertions(+), 75 deletions(-) rename application/admin/templates/de/code/{action_login_logout.ctp => action_admin_login_logout.ctp} (100%) rename application/admin/templates/de/code/{action_login_profile.ctp => action_admin_login_profile.ctp} (100%) rename application/admin/templates/de/code/{action_login_status_problem.ctp => action_admin_login_status_problem.ctp} (100%) create mode 100644 application/admin/templates/de/code/action_admin_login_welcome.ctp create mode 100644 application/admin/templates/de/code/action_admin_status_problem.ctp delete mode 100644 application/admin/templates/de/code/action_login_welcome.ctp rename application/blog/templates/de/code/{action_login_logout.ctp => action_blog_login_logout.ctp} (100%) rename application/blog/templates/de/code/{action_login_profile.ctp => action_blog_login_profile.ctp} (100%) rename application/blog/templates/de/code/{action_login_status_problem.ctp => action_blog_login_status_problem.ctp} (100%) rename application/blog/templates/de/code/{action_login_welcome.ctp => action_blog_login_welcome.ctp} (100%) rename application/ship-simu/main/actions/web/{class_WebLogin => class_WebShipSimuLogin} (90%) rename application/ship-simu/main/actions/web/{class_WebLoginCompanyAction.php => class_WebShipSimuLoginCompanyAction.php} (90%) rename application/ship-simu/main/actions/web/{class_WebLoginRefillAction.php => class_WebShipSimuLoginRefillAction.php} (91%) rename application/ship-simu/templates/de/code/{action_login_company.ctp => action_ship_simu_login_company.ctp} (100%) rename application/ship-simu/templates/de/code/{action_login_logout.ctp => action_ship_simu_login_logout.ctp} (100%) rename application/ship-simu/templates/de/code/{action_login_profile.ctp => action_ship_simu_login_profile.ctp} (100%) rename application/ship-simu/templates/de/code/{action_login_refill.ctp => action_ship_simu_login_refill.ctp} (100%) rename application/ship-simu/templates/de/code/{action_login_status_problem.ctp => action_ship_simu_login_status_problem.ctp} (100%) rename application/ship-simu/templates/de/code/{action_login_welcome.ctp => action_ship_simu_login_welcome.ctp} (100%) rename application/shoutbox/templates/de/code/{action_login_logout.ctp => action_shoutbox_login_logout.ctp} (100%) rename application/shoutbox/templates/de/code/{action_login_profile.ctp => action_shoutbox_login_profile.ctp} (100%) rename application/shoutbox/templates/de/code/{action_login_status_problem.ctp => action_shoutbox_login_status_problem.ctp} (100%) rename application/shoutbox/templates/de/code/{action_login_welcome.ctp => action_shoutbox_login_welcome.ctp} (100%) rename application/todo/templates/de/code/{action_login_logout.ctp => action_todo_login_logout.ctp} (100%) rename application/todo/templates/de/code/{action_login_profile.ctp => action_todo_login_profile.ctp} (100%) rename application/todo/templates/de/code/{action_login_status_problem.ctp => action_todo_login_status_problem.ctp} (100%) rename application/todo/templates/de/code/{action_login_welcome.ctp => action_todo_login_welcome.ctp} (100%) create mode 100644 inc/classes/main/application/.htaccess create mode 100644 inc/classes/main/application/class_BaseApplication.php diff --git a/.gitattributes b/.gitattributes index 7ed6550..6621d2a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -23,10 +23,11 @@ application/admin/main/login/helper/class_AdminLoginHelper.php -text application/admin/starter.php -text application/admin/templates/.htaccess -text application/admin/templates/de/.htaccess -text -application/admin/templates/de/code/action_login_logout.ctp -text -application/admin/templates/de/code/action_login_profile.ctp -text -application/admin/templates/de/code/action_login_status_problem.ctp -text -application/admin/templates/de/code/action_login_welcome.ctp -text +application/admin/templates/de/code/action_admin_login_logout.ctp -text +application/admin/templates/de/code/action_admin_login_profile.ctp -text +application/admin/templates/de/code/action_admin_login_status_problem.ctp -text +application/admin/templates/de/code/action_admin_login_welcome.ctp -text +application/admin/templates/de/code/action_admin_status_problem.ctp -text application/admin/templates/de/code/admin_main.ctp -text application/admin/templates/de/code/block_persona_data.ctp -text application/admin/templates/de/code/captch_graphic_code.ctp -text @@ -65,10 +66,10 @@ application/blog/main/class_ -text application/blog/starter.php -text application/blog/templates/.htaccess -text application/blog/templates/de/.htaccess -text -application/blog/templates/de/code/action_login_logout.ctp -text -application/blog/templates/de/code/action_login_profile.ctp -text -application/blog/templates/de/code/action_login_status_problem.ctp -text -application/blog/templates/de/code/action_login_welcome.ctp -text +application/blog/templates/de/code/action_blog_login_logout.ctp -text +application/blog/templates/de/code/action_blog_login_profile.ctp -text +application/blog/templates/de/code/action_blog_login_status_problem.ctp -text +application/blog/templates/de/code/action_blog_login_welcome.ctp -text application/blog/templates/de/code/block_persona_data.ctp -text application/blog/templates/de/code/blog_main.ctp -text application/blog/templates/de/code/captch_graphic_code.ctp -text @@ -155,9 +156,9 @@ application/ship-simu/main/actions/ship-simu/.htaccess -text application/ship-simu/main/actions/ship-simu/class_ShipSimuLoginAction.php -text application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php -text application/ship-simu/main/actions/web/.htaccess -text -application/ship-simu/main/actions/web/class_WebLogin -text -application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php -text -application/ship-simu/main/actions/web/class_WebLoginRefillAction.php -text +application/ship-simu/main/actions/web/class_WebShipSimuLogin -text +application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php -text +application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php -text application/ship-simu/main/bank/.htaccess -text application/ship-simu/main/bank/class_MoneyBank.php -text application/ship-simu/main/class_ -text @@ -254,12 +255,12 @@ application/ship-simu/main/wrapper/class_UserGovermentDatabaseWrapper.php -text application/ship-simu/starter.php -text application/ship-simu/templates/.htaccess -text application/ship-simu/templates/de/.htaccess -text -application/ship-simu/templates/de/code/action_login_company.ctp -text -application/ship-simu/templates/de/code/action_login_logout.ctp -text -application/ship-simu/templates/de/code/action_login_profile.ctp -text -application/ship-simu/templates/de/code/action_login_refill.ctp -text -application/ship-simu/templates/de/code/action_login_status_problem.ctp -text -application/ship-simu/templates/de/code/action_login_welcome.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp -text +application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp -text application/ship-simu/templates/de/code/block_company_data.ctp -text application/ship-simu/templates/de/code/block_persona_data.ctp -text application/ship-simu/templates/de/code/captch_graphic_code.ctp -text @@ -300,10 +301,10 @@ application/shoutbox/main/class_ -text application/shoutbox/starter.php -text application/shoutbox/templates/.htaccess -text application/shoutbox/templates/de/.htaccess -text -application/shoutbox/templates/de/code/action_login_logout.ctp -text -application/shoutbox/templates/de/code/action_login_profile.ctp -text -application/shoutbox/templates/de/code/action_login_status_problem.ctp -text -application/shoutbox/templates/de/code/action_login_welcome.ctp -text +application/shoutbox/templates/de/code/action_shoutbox_login_logout.ctp -text +application/shoutbox/templates/de/code/action_shoutbox_login_profile.ctp -text +application/shoutbox/templates/de/code/action_shoutbox_login_status_problem.ctp -text +application/shoutbox/templates/de/code/action_shoutbox_login_welcome.ctp -text application/shoutbox/templates/de/code/block_persona_data.ctp -text application/shoutbox/templates/de/code/captch_graphic_code.ctp -text application/shoutbox/templates/de/code/confirm_link.ctp -text @@ -343,10 +344,10 @@ application/todo/main/class_ -text application/todo/starter.php -text application/todo/templates/.htaccess -text application/todo/templates/de/.htaccess -text -application/todo/templates/de/code/action_login_logout.ctp -text -application/todo/templates/de/code/action_login_profile.ctp -text -application/todo/templates/de/code/action_login_status_problem.ctp -text -application/todo/templates/de/code/action_login_welcome.ctp -text +application/todo/templates/de/code/action_todo_login_logout.ctp -text +application/todo/templates/de/code/action_todo_login_profile.ctp -text +application/todo/templates/de/code/action_todo_login_status_problem.ctp -text +application/todo/templates/de/code/action_todo_login_welcome.ctp -text application/todo/templates/de/code/block_persona_data.ctp -text application/todo/templates/de/code/captch_graphic_code.ctp -text application/todo/templates/de/code/confirm_link.ctp -text @@ -595,6 +596,8 @@ inc/classes/main/actions/post_registration/.htaccess -text inc/classes/main/actions/post_registration/class_LoginAfterRegistrationAction.php -text inc/classes/main/actions/web/.htaccess -text inc/classes/main/actions/web/class_WebLoginProfileAction.php -text +inc/classes/main/application/.htaccess -text +inc/classes/main/application/class_BaseApplication.php -text inc/classes/main/auth/.htaccess -text inc/classes/main/auth/class_CookieAuth.php -text inc/classes/main/cache/.htaccess -text diff --git a/application/admin/class_ApplicationHelper.php b/application/admin/class_ApplicationHelper.php index 35888cd..c041e08 100644 --- a/application/admin/class_ApplicationHelper.php +++ b/application/admin/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -78,10 +78,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/admin/templates/de/code/action_login_logout.ctp b/application/admin/templates/de/code/action_admin_login_logout.ctp similarity index 100% rename from application/admin/templates/de/code/action_login_logout.ctp rename to application/admin/templates/de/code/action_admin_login_logout.ctp diff --git a/application/admin/templates/de/code/action_login_profile.ctp b/application/admin/templates/de/code/action_admin_login_profile.ctp similarity index 100% rename from application/admin/templates/de/code/action_login_profile.ctp rename to application/admin/templates/de/code/action_admin_login_profile.ctp diff --git a/application/admin/templates/de/code/action_login_status_problem.ctp b/application/admin/templates/de/code/action_admin_login_status_problem.ctp similarity index 100% rename from application/admin/templates/de/code/action_login_status_problem.ctp rename to application/admin/templates/de/code/action_admin_login_status_problem.ctp diff --git a/application/admin/templates/de/code/action_admin_login_welcome.ctp b/application/admin/templates/de/code/action_admin_login_welcome.ctp new file mode 100644 index 0000000..749b239 --- /dev/null +++ b/application/admin/templates/de/code/action_admin_login_welcome.ctp @@ -0,0 +1,13 @@ +
+ {?admin_overview?} +
+ +
+
+ {?updates_header?} +
+ +
+ {?updates_content?} +
+
diff --git a/application/admin/templates/de/code/action_admin_status_problem.ctp b/application/admin/templates/de/code/action_admin_status_problem.ctp new file mode 100644 index 0000000..4c57125 --- /dev/null +++ b/application/admin/templates/de/code/action_admin_status_problem.ctp @@ -0,0 +1,61 @@ +prefetchValueInstance('user'); + +// Add submit button or notice +if ($helper->ifUserAccountUnconfirmed()) { + // Add submit button + $helper->addInputHiddenFieldWithDefault('email'); + $helper->addInputSubmitButton("Bestätigungslink erneut aussenden"); +} elseif ($helper->ifUserAccountLocked()) { + // Account is locked + $helper->addFormNote('status_locked', "Dein Account wurde gesperrt! Grund der Sperre: + ".$helper->getValueField('lock_reason')." + Bitte melde dich beim Support, damit dieser dir weiterhelfen kann." + ); +} + +// Flush content and automatically close the form +$helper->flushContent(); + +if ($helper->ifUserAccountUnconfirmed()) { + // Build the form for confirmation + $helper = WebFormHelper::createWebFormHelper($this, "confirm_code"); + + // Add code box + $helper->addFormGroup('code', "Bitte gebe hier den Bestätigungscode aus der Willkommensemail ein. Solltest du diese nicht erhalten haben, kannst du dir diesen jetzt zusenden lassen."); + $helper->addFieldText('code', "Bestätigungscode aus der Mail:"); + $helper->addInputTextField('code'); + + // Add submit button + $helper->addFormGroup('buttons', "Bitte einmal abschicken und das Ergebnis abwarten!"); + $helper->addInputResetButton("Nochmal eingeben"); + $helper->addInputSubmitButton("Bestätigungscode absenden"); + + // Flush content and automatically close the form + $helper->flushContent(); +} // END - if +?> +
+ Problem mit deinem Account gefunden: +
+ +
+ Du bist möglicherweise für deine ausgewählte Aktion nicht + berechtigt oder du hast noch deine Email-Adresse nicht bestätigt. Du + kannst dir nun den Bestätigungslink erneut aussenden lassen, oder den + Bestätigungscode unten eingeben. + + + +
+ {?confirm_code?} +
+
diff --git a/application/admin/templates/de/code/action_login_welcome.ctp b/application/admin/templates/de/code/action_login_welcome.ctp deleted file mode 100644 index df64eaf..0000000 --- a/application/admin/templates/de/code/action_login_welcome.ctp +++ /dev/null @@ -1,3 +0,0 @@ -
- {?admin_login_news?} -
diff --git a/application/admin/templates/de/code/login_main.ctp b/application/admin/templates/de/code/login_main.ctp index fecb5d1..edfdab6 100644 --- a/application/admin/templates/de/code/login_main.ctp +++ b/application/admin/templates/de/code/login_main.ctp @@ -34,14 +34,14 @@ $helper->flushContent(); // End of all PHP commands ?>
- Willkommen im Loginbereich zum {?app_full_name?}! + Willkommen zum {?app_full_name?}!
{?login_content?}
-
+
Account-Infos:
diff --git a/application/blog/class_ApplicationHelper.php b/application/blog/class_ApplicationHelper.php index fcbafe2..b14778f 100644 --- a/application/blog/class_ApplicationHelper.php +++ b/application/blog/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -78,10 +78,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/blog/templates/de/code/action_login_logout.ctp b/application/blog/templates/de/code/action_blog_login_logout.ctp similarity index 100% rename from application/blog/templates/de/code/action_login_logout.ctp rename to application/blog/templates/de/code/action_blog_login_logout.ctp diff --git a/application/blog/templates/de/code/action_login_profile.ctp b/application/blog/templates/de/code/action_blog_login_profile.ctp similarity index 100% rename from application/blog/templates/de/code/action_login_profile.ctp rename to application/blog/templates/de/code/action_blog_login_profile.ctp diff --git a/application/blog/templates/de/code/action_login_status_problem.ctp b/application/blog/templates/de/code/action_blog_login_status_problem.ctp similarity index 100% rename from application/blog/templates/de/code/action_login_status_problem.ctp rename to application/blog/templates/de/code/action_blog_login_status_problem.ctp diff --git a/application/blog/templates/de/code/action_login_welcome.ctp b/application/blog/templates/de/code/action_blog_login_welcome.ctp similarity index 100% rename from application/blog/templates/de/code/action_login_welcome.ctp rename to application/blog/templates/de/code/action_blog_login_welcome.ctp diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index d51ca02..005c1e6 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -73,10 +73,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index c2651dc..bd51594 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -78,10 +78,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index 0240453..dd52a7b 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -307,8 +307,8 @@ $cfg->setConfigEntry('refill_page_active', "Y"); // CFG: REFILL-PAGE-MIN-CURRENCY-AMOUNT $cfg->setConfigEntry('refill_page_min_currency_amount', 1000); -// CFG: LOGIN-FILL-PAYMENT-DISCOVERY -$cfg->setConfigEntry('login_refill_payment_discovery', "LocalPaymentDiscovery"); +// CFG: SHIP-SIMU-LOGIN-FILL-PAYMENT-DISCOVERY +$cfg->setConfigEntry('ship_simu_login_refill_payment_discovery', "LocalPaymentDiscovery"); // [EOF] ?> diff --git a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php index 6c45260..d6a5649 100644 --- a/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php +++ b/application/ship-simu/main/actions/ship-simu/class_ShipSimuProfileAction.php @@ -51,9 +51,10 @@ class ShipSimuProfileAction extends BaseAction implements PerformableAction { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void + * @todo Maybe we need to do something later here */ */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - /* @TODO Maybe we need to do something later here */ + // Empty for now } } diff --git a/application/ship-simu/main/actions/web/class_WebLogin b/application/ship-simu/main/actions/web/class_WebShipSimuLogin similarity index 90% rename from application/ship-simu/main/actions/web/class_WebLogin rename to application/ship-simu/main/actions/web/class_WebShipSimuLogin index c234cd4..b2959ff 100644 --- a/application/ship-simu/main/actions/web/class_WebLogin +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLogin @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class WebLogin???Action extends BaseAction implements Commandable, Registerable { +class WebShipSimuLogin???Action extends BaseAction implements Commandable, Registerable { /** * Protected constructor * @@ -38,9 +38,9 @@ class WebLogin???Action extends BaseAction implements Commandable, Registerable * @param $resolverInstance An instance of an action resolver * @return $actionInstance An instance of this action class */ - public final static function createWebLogin???Action (ActionResolver $resolverInstance) { + public final static function createWebShipSimuLogin???Action (ActionResolver $resolverInstance) { // Get a new instance - $actionInstance = new WebLogin???Action(); + $actionInstance = new WebShipSimuLogin???Action(); // Set the resolver instance $actionInstance->setResolverInstance($resolverInstance); diff --git a/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php similarity index 90% rename from application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php rename to application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php index edc7e19..e416055 100644 --- a/application/ship-simu/main/actions/web/class_WebLoginCompanyAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class WebLoginCompanyAction extends BaseAction implements Commandable, Registerable { +class WebShipSimuLoginCompanyAction extends BaseAction implements Commandable, Registerable { /** * Protected constructor * @@ -38,9 +38,9 @@ class WebLoginCompanyAction extends BaseAction implements Commandable, Registera * @param $resolverInstance An instance of an action resolver * @return $actionInstance An instance of this action class */ - public final static function createWebLoginCompanyAction (ActionResolver $resolverInstance) { + public final static function createWebShipSimuLoginCompanyAction (ActionResolver $resolverInstance) { // Get a new instance - $actionInstance = new WebLoginCompanyAction(); + $actionInstance = new WebShipSimuLoginCompanyAction(); // Set the resolver instance $actionInstance->setResolverInstance($resolverInstance); diff --git a/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php similarity index 91% rename from application/ship-simu/main/actions/web/class_WebLoginRefillAction.php rename to application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php index 77f18f5..fc25b95 100644 --- a/application/ship-simu/main/actions/web/class_WebLoginRefillAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class WebLoginRefillAction extends BaseAction implements Commandable, Registerable { +class WebShipSimuLoginRefillAction extends BaseAction implements Commandable, Registerable { /** * Protected constructor * @@ -38,9 +38,9 @@ class WebLoginRefillAction extends BaseAction implements Commandable, Registerab * @param $resolverInstance An instance of an action resolver * @return $actionInstance An instance of this action class */ - public final static function createWebLoginRefillAction (ActionResolver $resolverInstance) { + public final static function createWebShipSimuLoginRefillAction (ActionResolver $resolverInstance) { // Get a new instance - $actionInstance = new WebLoginRefillAction(); + $actionInstance = new WebShipSimuLoginRefillAction(); // Set the resolver instance $actionInstance->setResolverInstance($resolverInstance); diff --git a/application/ship-simu/templates/de/code/action_login_company.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_company.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp diff --git a/application/ship-simu/templates/de/code/action_login_logout.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_logout.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_logout.ctp diff --git a/application/ship-simu/templates/de/code/action_login_profile.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_profile.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_profile.ctp diff --git a/application/ship-simu/templates/de/code/action_login_refill.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_refill.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_refill.ctp diff --git a/application/ship-simu/templates/de/code/action_login_status_problem.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_status_problem.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_status_problem.ctp diff --git a/application/ship-simu/templates/de/code/action_login_welcome.ctp b/application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp similarity index 100% rename from application/ship-simu/templates/de/code/action_login_welcome.ctp rename to application/ship-simu/templates/de/code/action_ship_simu_login_welcome.ctp diff --git a/application/shoutbox/class_ApplicationHelper.php b/application/shoutbox/class_ApplicationHelper.php index 1dbc550..4adc321 100644 --- a/application/shoutbox/class_ApplicationHelper.php +++ b/application/shoutbox/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -78,10 +78,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/shoutbox/templates/de/code/action_login_logout.ctp b/application/shoutbox/templates/de/code/action_shoutbox_login_logout.ctp similarity index 100% rename from application/shoutbox/templates/de/code/action_login_logout.ctp rename to application/shoutbox/templates/de/code/action_shoutbox_login_logout.ctp diff --git a/application/shoutbox/templates/de/code/action_login_profile.ctp b/application/shoutbox/templates/de/code/action_shoutbox_login_profile.ctp similarity index 100% rename from application/shoutbox/templates/de/code/action_login_profile.ctp rename to application/shoutbox/templates/de/code/action_shoutbox_login_profile.ctp diff --git a/application/shoutbox/templates/de/code/action_login_status_problem.ctp b/application/shoutbox/templates/de/code/action_shoutbox_login_status_problem.ctp similarity index 100% rename from application/shoutbox/templates/de/code/action_login_status_problem.ctp rename to application/shoutbox/templates/de/code/action_shoutbox_login_status_problem.ctp diff --git a/application/shoutbox/templates/de/code/action_login_welcome.ctp b/application/shoutbox/templates/de/code/action_shoutbox_login_welcome.ctp similarity index 100% rename from application/shoutbox/templates/de/code/action_login_welcome.ctp rename to application/shoutbox/templates/de/code/action_shoutbox_login_welcome.ctp diff --git a/application/todo/class_ApplicationHelper.php b/application/todo/class_ApplicationHelper.php index 7380296..4e3c957 100644 --- a/application/todo/class_ApplicationHelper.php +++ b/application/todo/class_ApplicationHelper.php @@ -39,7 +39,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplication { +class ApplicationHelper extends BaseApplication implements ManageableApplication, Registerable { /** * The version number of this application */ @@ -78,10 +78,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Tidy up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } /** diff --git a/application/todo/templates/de/code/action_login_logout.ctp b/application/todo/templates/de/code/action_todo_login_logout.ctp similarity index 100% rename from application/todo/templates/de/code/action_login_logout.ctp rename to application/todo/templates/de/code/action_todo_login_logout.ctp diff --git a/application/todo/templates/de/code/action_login_profile.ctp b/application/todo/templates/de/code/action_todo_login_profile.ctp similarity index 100% rename from application/todo/templates/de/code/action_login_profile.ctp rename to application/todo/templates/de/code/action_todo_login_profile.ctp diff --git a/application/todo/templates/de/code/action_login_status_problem.ctp b/application/todo/templates/de/code/action_todo_login_status_problem.ctp similarity index 100% rename from application/todo/templates/de/code/action_login_status_problem.ctp rename to application/todo/templates/de/code/action_todo_login_status_problem.ctp diff --git a/application/todo/templates/de/code/action_login_welcome.ctp b/application/todo/templates/de/code/action_todo_login_welcome.ctp similarity index 100% rename from application/todo/templates/de/code/action_login_welcome.ctp rename to application/todo/templates/de/code/action_todo_login_welcome.ctp diff --git a/inc/classes/main/application/.htaccess b/inc/classes/main/application/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/application/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/application/class_BaseApplication.php b/inc/classes/main/application/class_BaseApplication.php new file mode 100644 index 0000000..a8d5e5c --- /dev/null +++ b/inc/classes/main/application/class_BaseApplication.php @@ -0,0 +1,48 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class BaseApplication extends BaseFrameworkSystem { + /** + * Protected constructor + * + * @param $className Name of the class + * @return void + */ + protected function __construct ($className) { + // Call parent constructor + parent::__construct($className); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + + // Get registry instance + $registryInstance = Registry::getRegistry(); + + // Add this instance + $registryInstance->addInstance('application', $this); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php index 9f2c1cf..3149a25 100644 --- a/inc/classes/main/commands/web/class_WebLoginAreaCommand.php +++ b/inc/classes/main/commands/web/class_WebLoginAreaCommand.php @@ -152,8 +152,17 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { // Default is no action $actionInstance = null; + // Get registry + $registryInstance = Registry::getRegistry(); + + // Get our application instance from the registry + $appInstance = $registryInstance->getInstance('application'); + // Default action is the one from configuration - $this->actionName = sprintf("login_%s", $this->getConfigInstance()->readConfig('login_default_action')); + $this->actionName = sprintf("%s_login_%s", + str_replace("-", "_", $appInstance->getAppShortName()), + $this->getConfigInstance()->readConfig('login_default_action') + ); // Get "action" from request $actReq = $requestInstance->getRequestElement('action'); @@ -161,7 +170,10 @@ class WebLoginAreaCommand extends BaseCommand implements Commandable { // Do we have a "action" parameter set? if ((is_string($actReq)) && (!empty($actReq))) { // Then use it with prefix - $this->actionName = sprintf("login_%s", $actReq); + $this->actionName = sprintf("%s_login_%s", + str_replace("-", "_", $appInstance->getAppShortName()), + $actReq + ); } // END - if // Get application instance diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index 40d9c66..7c6a3ff 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -63,6 +63,9 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { // Set link base $helperInstance->setLinkBase($linkBase); + // Add default group + $helperInstance->openGroupByIdContent('main', ""); + // Return the prepared instance return $helperInstance; } diff --git a/inc/classes/main/resolver/action/class_BaseActionResolver.php b/inc/classes/main/resolver/action/class_BaseActionResolver.php index eef7b46..9e92771 100644 --- a/inc/classes/main/resolver/action/class_BaseActionResolver.php +++ b/inc/classes/main/resolver/action/class_BaseActionResolver.php @@ -60,7 +60,7 @@ class BaseActionResolver extends BaseResolver { * @return void */ protected final function setActionName ($actionName) { - $this->actionName = $actionName; + $this->actionName = (string) $actionName; } /** -- 2.39.5