aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/sites.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index add5424e2..b7af3a3c3 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -135,6 +135,10 @@
*/
public function delete()
{
+ global $CONFIG;
+ if ($CONFIG->site->getGUID() == $this->guid)
+ throw new SecurityException('SecurityException:deletedisablecurrentsite');
+
if (!delete_site_entity($this->get('guid')))
return false;
@@ -142,6 +146,20 @@
}
/**
+ * Disable override to add safety rail.
+ *
+ * @param unknown_type $reason
+ */
+ public function disable($reason = "")
+ {
+ global $CONFIG;
+ if ($CONFIG->site->getGUID() == $this->guid)
+ throw new SecurityException('SecurityException:deletedisablecurrentsite');
+
+ return parent::disable($reason);
+ }
+
+ /**
* Return a list of users using this site.
*
* @param int $limit