mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-11 01:40:13 +00:00
deactivating a plugin in ams
This commit is contained in:
parent
408a192887
commit
5648a7183d
1 changed files with 37 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This function is used in deactivating plugins.
|
||||||
|
*
|
||||||
|
* @author Shubham Meena, mentored by Matthew Lagoe
|
||||||
|
*/
|
||||||
|
function deactivate_plugin() {
|
||||||
|
|
||||||
|
// if logged in
|
||||||
|
if ( WebUsers :: isLoggedIn() ) {
|
||||||
|
|
||||||
|
|
||||||
|
if ( isset( $_GET['id'] ) )
|
||||||
|
{
|
||||||
|
// id of plugin to delete
|
||||||
|
$id = filter_var( $_GET['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS );
|
||||||
|
$db = new DBLayer( 'lib' );
|
||||||
|
$result = $db -> update( "plugins", array( 'Status' => '0' ), "Id = $id" );
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
header( "Location: index.php?page=plugins&result=5" );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header( "Location: index.php?page=plugins&result=6" );
|
||||||
|
exit;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
header( "Location: index.php?page=plugins&result=6" );
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue