activating a plugin in ams
--HG-- branch : Gsoc14-ryzomAppImprovements
This commit is contained in:
parent
59a6c6b8c3
commit
2f81e3c1b9
1 changed files with 35 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
||||||
|
<?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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue