The code used to identify for the plugin is now renamed by plugin_code
This commit is contained in:
parent
c6ed580d18
commit
82e05f0342
5 changed files with 10 additions and 10 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* The code (of the plugin) is required
|
||||
* Required variable in $_REQUEST
|
||||
* - gDossier
|
||||
* - code
|
||||
* - plugin_code
|
||||
*/
|
||||
require_once('class_database.php');
|
||||
require_once('class_user.php');
|
||||
|
|
@ -17,10 +17,10 @@ $user=new User($cn);
|
|||
$user->check(true);
|
||||
|
||||
/* if a code has been asked */
|
||||
if (isset($_REQUEST['code']) ) {
|
||||
if (isset($_REQUEST['plugin_code']) ) {
|
||||
|
||||
$ext=new Extension($cn);
|
||||
$ext->search('code',$_REQUEST['code']);
|
||||
$ext->search('code',$_REQUEST['plugin_code']);
|
||||
if ( $ext->get_parameter('id') != 0 ) {
|
||||
/* security */
|
||||
if ( !isset ($_SESSION['g_user']) || $ext->can_request($_SESSION['g_user']) == 0 ) {
|
||||
|
|
|
|||
|
|
@ -73,16 +73,16 @@ echo <<<EOF
|
|||
EOF;
|
||||
}
|
||||
/* show all the extension we can access */
|
||||
$a=new ISelect('code');
|
||||
$a=new ISelect('plugin_code');
|
||||
$a->value=Extension::make_array($cn);
|
||||
$a->selected=(isset($_REQUEST['code']))?strtoupper($_REQUEST['code']):'';
|
||||
$a->selected=(isset($_REQUEST['plugin_code']))?strtoupper($_REQUEST['plugin_code']):'';
|
||||
|
||||
/* no plugin available */
|
||||
if ( count($a->value) == 0 ) {alert(j(_("Aucune extension disponible")));exit;}
|
||||
|
||||
/* only one plugin available then we don't propose a choice*/
|
||||
if ( count($a->value)==1 ) {
|
||||
$_REQUEST['code']=$a->value[0]['value'];
|
||||
$_REQUEST['plugin_code']=$a->value[0]['value'];
|
||||
} else {
|
||||
echo '<form method="get" action="extension.php">';
|
||||
echo $hidden;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
* - $variable :
|
||||
* - id (extension.ex_id)
|
||||
* - name (extension.ex_name)
|
||||
* - code (extension.ex_code)
|
||||
* - plugin_code (extension.ex_code)
|
||||
* - desc (extension.ex_desc)
|
||||
* - enable (extension.ex_enable)
|
||||
* - filepath (extension.ex_file)
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ echo $string => property={'prop':'1','prop2':'2','prop3':'3'};
|
|||
}
|
||||
|
||||
static function extension() {
|
||||
return self::hidden('code',$_REQUEST['code']);
|
||||
return self::hidden('plugin_code',$_REQUEST['plugin_code']);
|
||||
}
|
||||
|
||||
/*!\brief create a button with a ref
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
/* if a code has been asked */
|
||||
if (isset($_REQUEST['code']) ) {
|
||||
if (isset($_REQUEST['plugin_code']) ) {
|
||||
$cn=new Database(dossier::id());
|
||||
$ext=new Extension($cn);
|
||||
$ext->search('code',$_REQUEST['code']);
|
||||
$ext->search('code',$_REQUEST['plugin_code']);
|
||||
if ( $ext->get_parameter('id') != 0 ) {
|
||||
/* security */
|
||||
if ( $ext->can_request($_SESSION['g_user']) == 0 ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue