Staff ticket emails and some stock plugins link to admin/ and ignore a renamed admin folder

Sheernox

New Member
Env: ClientExec 7.2.2 (ionCube), PHP 8.5.10, MariaDB 11.8.9.

Where:
  • The [TICKETURL] merge tag in the staff ticket templates (Support Ticket Assigned, Notify Assignee For Ticket Reply, Notify Department Lead For New Ticket, Notify Department List For New Ticket, Notify Support For New High Priority Tickets, Notify For New FeedBack). The code that fills it is encoded, so no line number. The staff link comes from the 7.0.1 change "Fixed the [TICKETURL] tag in support emails linking to the old ticket URL for staff members".
  • plugins/reports/Revenue/Annual_Revenue.php line 474, Revenue_And_Taxes.php line 360, Revenue_Forecast.php line 355 and Server_Revenue_Forecast.php line 303 build the drill-down popup URL as the software URL plus a literal admin/index.php.
  • plugins/import/whmcs/PluginWhmcs.phtml line 15, plugins/import/blesta/PluginBlesta.phtml line 18 and plugins/import/ceformat/PluginCeformat.phtml line 32 link the currency settings as ../admin/index.php.

Bug: With the admin folder renamed, all of these links point at /admin/index.php, which returns 404. The admin area itself and its other links follow NE_CONTROLLER_ADMIN_DIR. Only staff ticket emails were seen with the bad link; client ticket emails use the same tag for a client portal link.

Repro:
  1. Set NE_CONTROLLER_ADMIN_DIR to /renamedadmin in config.php and rename the admin folder to renamedadmin.
  2. Assign a ticket to a staff member. The Support Ticket Assigned email (like every staff ticket notification) links to /admin/index.php?frmClientID=1042&fuse=support&id=272805&view=ticket&controller=ticket, which returns 404.
  3. Run Reports > Revenue > Annual Revenue and click a month. The popup opens /admin/index.php?noheaderfooter=1&getinvoices=1..., which returns 404.

Fix: Build these URLs from NE_CONTROLLER_ADMIN_DIR, as the admin area does, instead of the literal admin.
 
Back
Top