Пример #1
0
 static function getMenuContent()
 {
     global $CFG_GLPI;
     $image = "<img src='" . $CFG_GLPI["root_doc"] . "/plugins/accounts/pics/cadenas.png' title='" . _n('Encryption key', 'Encryption keys', 2) . "' alt='" . _n('Encryption key', 'Encryption keys', 2, 'accounts') . "'>";
     $menu = array();
     $menu['title'] = self::getMenuName();
     $menu['page'] = "/plugins/accounts/front/account.php";
     $menu['page'] = "/plugins/accounts/front/account.php";
     $menu['links']['search'] = PluginAccountsAccount::getSearchURL(false);
     $menu['links'][$image] = PluginAccountsHash::getSearchURL(false);
     if (PluginAccountsAccount::canCreate()) {
         $menu['links']['add'] = PluginAccountsAccount::getFormURL(false);
     }
     $menu['options']['account']['title'] = PluginAccountsAccount::getTypeName(2);
     $menu['options']['account']['page'] = PluginAccountsAccount::getSearchURL(false);
     $menu['options']['account']['links']['search'] = PluginAccountsAccount::getSearchURL(false);
     $menu['options']['account']['links'][$image] = PluginAccountsHash::getSearchURL(false);
     if (PluginAccountsAccount::canCreate()) {
         $menu['options']['account']['links']['add'] = PluginAccountsAccount::getFormURL(false);
     }
     $menu['options']['hash']['title'] = PluginAccountsHash::getTypeName(2);
     $menu['options']['hash']['page'] = PluginAccountsHash::getSearchURL(false);
     $menu['options']['hash']['links']['search'] = PluginAccountsHash::getSearchURL(false);
     $menu['options']['hash']['links'][$image] = PluginAccountsHash::getSearchURL(false);
     if (PluginAccountsHash::canCreate()) {
         $menu['options']['hash']['links']['add'] = PluginAccountsHash::getFormURL(false);
     }
     return $menu;
 }
Пример #2
0
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$account = new PluginAccountsAccount();
$account_item = new PluginAccountsAccount_Item();
if (isset($_POST["add"])) {
    $account->check(-1, CREATE, $_POST);
    $newID = $account->add($_POST);
    if ($_SESSION['glpibackcreated']) {
        Html::redirect($account->getFormURL() . "?id=" . $newID);
    }
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $account->check($_POST['id'], UPDATE);
        $account->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            $account->check($_POST['id'], DELETE);
            $account->delete($_POST);
            $account->redirectToList();
        } else {
            if (isset($_POST["restore"])) {
                $account->check($_POST['id'], PURGE);