File tree Expand file tree Collapse file tree 5 files changed +2
-73
lines changed
installation/src/Application Expand file tree Collapse file tree 5 files changed +2
-73
lines changed Original file line number Diff line number Diff line change @@ -311,21 +311,4 @@ public function isClient($identifier)
311311 {
312312 return 'cli_installation ' === $ identifier ;
313313 }
314-
315- /**
316- * Flag if the application instance is a CLI or web based application.
317- *
318- * Helper function, you should use the native PHP functions to detect if it is a CLI application.
319- *
320- * @return boolean
321- *
322- * @since 4.3.0
323- *
324- * @deprecated 4.3 will be removed in 5.0
325- * Use $app->isClient('cli_installation') instead
326- */
327- public function isCli ()
328- {
329- return $ this ->isClient ('cli_installation ' );
330- }
331314}
Original file line number Diff line number Diff line change @@ -1288,23 +1288,6 @@ public function checkToken($method = 'post')
12881288 return $ session ::checkToken ($ method );
12891289 }
12901290
1291- /**
1292- * Flag if the application instance is a CLI or web based application.
1293- *
1294- * Helper function, you should use the native PHP functions to detect if it is a CLI application.
1295- *
1296- * @return boolean
1297- *
1298- * @since 4.0.0
1299- *
1300- * @deprecated 4.0 will be removed in 6.0
1301- * Will be removed without replacements
1302- */
1303- public function isCli ()
1304- {
1305- return false ;
1306- }
1307-
13081291 /**
13091292 * No longer used
13101293 *
Original file line number Diff line number Diff line change @@ -124,20 +124,6 @@ public function getMessageQueue();
124124 */
125125 public function isClient ($ identifier );
126126
127- /**
128- * Flag if the application instance is a CLI or web based application.
129- *
130- * Helper function, you should use the native PHP functions to detect if it is a CLI application.
131- *
132- * @return boolean
133- *
134- * @since 4.0.0
135- *
136- * @deprecated 4.0 will be removed in 6.0
137- * Will be removed without replacement. CLI will be handled by the joomla/console package instead
138- */
139- public function isCli ();
140-
141127 /**
142128 * Get the application identity.
143129 *
Original file line number Diff line number Diff line change @@ -387,23 +387,6 @@ public function isClient($identifier)
387387 return $ this ->getName () === $ identifier ;
388388 }
389389
390- /**
391- * Flag if the application instance is a CLI or web based application.
392- *
393- * Helper function, you should use the native PHP functions to detect if it is a CLI application.
394- *
395- * @return boolean
396- *
397- * @since 4.0.0
398- *
399- * @deprecated 4.0 will be removed in 6.0
400- * Will be removed without replacement. CLI will be handled by the joomla/console package instead
401- */
402- public function isCli ()
403- {
404- return true ;
405- }
406-
407390 /**
408391 * Sets the session for the application to use, if required.
409392 *
Original file line number Diff line number Diff line change 1010namespace Joomla \CMS \User ;
1111
1212use Joomla \CMS \Access \Access ;
13+ use Joomla \CMS \Application \ConsoleApplication ;
1314use Joomla \CMS \Event \User \AfterDeleteEvent ;
1415use Joomla \CMS \Event \User \AfterSaveEvent ;
1516use Joomla \CMS \Event \User \BeforeDeleteEvent ;
@@ -743,15 +744,8 @@ public function save($updateOnly = false)
743744 $ iAmRehashingSuperadmin = true ;
744745 }
745746
746- // Check if we are using a CLI application
747- $ isCli = false ;
748-
749- if (Factory::getApplication ()->isCli ()) {
750- $ isCli = true ;
751- }
752-
753747 // We are only worried about edits to this account if I am not a Super Admin.
754- if ($ iAmSuperAdmin != true && $ iAmRehashingSuperadmin != true && $ isCli != true ) {
748+ if ($ iAmSuperAdmin != true && $ iAmRehashingSuperadmin != true && !Factory:: getApplication () instanceof ConsoleApplication ) {
755749 // I am not a Super Admin, and this one is, so fail.
756750 if (!$ isNew && Access::check ($ this ->id , 'core.admin ' )) {
757751 throw new \RuntimeException ('User not Super Administrator ' );
You can’t perform that action at this time.
0 commit comments