User delete functionality
This commit is contained in:
parent
cc7738ff9e
commit
42ec373c5f
|
@ -43,6 +43,11 @@ function deleteUser($args, $deleteContent=false)
|
||||||
global $dbPosts;
|
global $dbPosts;
|
||||||
global $Language;
|
global $Language;
|
||||||
|
|
||||||
|
// The user admin cannot be deleted.
|
||||||
|
if($args['username']=='admin') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if($deleteContent) {
|
if($deleteContent) {
|
||||||
$dbPosts->deletePostsByUser($args['username']);
|
$dbPosts->deletePostsByUser($args['username']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,14 @@
|
||||||
<script src="./js/kube.min.js"></script>
|
<script src="./js/kube.min.js"></script>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php
|
<?php Theme::plugins('onAdminHead') ?>
|
||||||
Theme::plugins('onAdminHead');
|
|
||||||
?>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<!-- Plugins -->
|
||||||
|
<?php Theme::plugins('onAdminBodyBegin') ?>
|
||||||
|
|
||||||
<!-- ALERT -->
|
<!-- ALERT -->
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
@ -91,9 +93,7 @@ $(document).ready(function() {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php
|
<?php Theme::plugins('onAdminBodyEnd') ?>
|
||||||
Theme::plugins('onAdminBody');
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
|
echo "DEBUG: Load time: ".(microtime(true) - $loadTime).'<br>';
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
<li><a href="#profile"><?php $Language->p('Profile') ?></a></li>
|
<li><a href="#profile"><?php $Language->p('Profile') ?></a></li>
|
||||||
<li><a href="#email"><?php $Language->p('Email') ?></a></li>
|
<li><a href="#email"><?php $Language->p('Email') ?></a></li>
|
||||||
<li><a href="#password"><?php $Language->p('Password') ?></a></li>
|
<li><a href="#password"><?php $Language->p('Password') ?></a></li>
|
||||||
|
|
||||||
|
<?php if($_user['username']!=='admin') { ?>
|
||||||
<li><a href="#delete"><?php $Language->p('Delete') ?></a></li>
|
<li><a href="#delete"><?php $Language->p('Delete') ?></a></li>
|
||||||
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
@ -99,6 +102,7 @@
|
||||||
<!-- ===================================== -->
|
<!-- ===================================== -->
|
||||||
<!-- Delete -->
|
<!-- Delete -->
|
||||||
<!-- ===================================== -->
|
<!-- ===================================== -->
|
||||||
|
<?php if($_user['username']!=='admin') { ?>
|
||||||
|
|
||||||
<div id="delete">
|
<div id="delete">
|
||||||
|
|
||||||
|
@ -117,3 +121,5 @@
|
||||||
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
|
<a href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>" class="btn"><?php $Language->p('Cancel') ?></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php } ?>
|
|
@ -204,7 +204,12 @@ class Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onSiteBody()
|
public function onSiteBodyBegin()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onSiteBodyEnd()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +219,12 @@ class Plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAdminBody()
|
public function onAdminBodyBegin()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onAdminBodyEnd()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,13 @@
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
$plugins = array(
|
$plugins = array(
|
||||||
'onSiteHead'=>array(),
|
'onSiteHead'=>array(), // <html><head>HERE</head><body>...</body></html>
|
||||||
'onSiteBody'=>array(),
|
'onSiteBodyBegin'=>array(), // <html><head>...</head><body>HERE...</body></html>
|
||||||
'onSiteSidebar'=>array(),
|
'onSiteBodyEnd'=>array(), // <html><head>...</head><body>...HERE</body></html>
|
||||||
|
'onSiteSidebar'=>array(), // <html><head>...</head><body>...<sidebar>HERE</sidebar>...</body></html>
|
||||||
'onAdminHead'=>array(),
|
'onAdminHead'=>array(),
|
||||||
'onAdminBody'=>array(),
|
'onAdminBodyBegin'=>array(),
|
||||||
|
'onAdminBodyEnd'=>array(),
|
||||||
'onAdminSidebar'=>array(),
|
'onAdminSidebar'=>array(),
|
||||||
'beforeSiteLoad'=>array(),
|
'beforeSiteLoad'=>array(),
|
||||||
'afterSiteLoad'=>array(),
|
'afterSiteLoad'=>array(),
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<!-- Plugins -->
|
<!-- Plugins -->
|
||||||
<?php Theme::plugins('onSiteBody') ?>
|
<?php Theme::plugins('onSiteBodyBegin') ?>
|
||||||
|
|
||||||
<!-- Layout -->
|
<!-- Layout -->
|
||||||
<div id="layout" class="pure-g">
|
<div id="layout" class="pure-g">
|
||||||
|
@ -47,5 +47,8 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Plugins -->
|
||||||
|
<?php Theme::plugins('onSiteBodyEnd') ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue