mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-24 15:56:22 +00:00
35 lines
989 B
PHP
35 lines
989 B
PHP
<?php
|
|
/**
|
|
* This function is used in activating plugins.
|
|
*
|
|
* @author Shubham Meena, mentored by Matthew Lagoe
|
|
*/
|
|
function activate_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' => '1' ), "Id = $id" );
|
|
if ( $result )
|
|
{
|
|
header( "Location: index.php?page=plugins&result=3" );
|
|
exit;
|
|
}
|
|
else
|
|
{
|
|
header( "Location: index.php?page=plugins&result=4" );
|
|
exit;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
header( "Location: index.php?page=plugins&result=4" );
|
|
exit;
|
|
}
|
|
}
|
|
}
|