当前位置: 首页>>代码示例>>PHP>>正文


PHP Computer::check方法代码示例

本文整理汇总了PHP中Computer::check方法的典型用法代码示例。如果您正苦于以下问题:PHP Computer::check方法的具体用法?PHP Computer::check怎么用?PHP Computer::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Computer的用法示例。


在下文中一共展示了Computer::check方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Computer

(at your option) any later version.

ocsinventoryng is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ocsinventoryng. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
Session::checkRight("computer", READ);
if (isset($_POST["force_ocs_resynch"])) {
    $computer = new Computer();
    $computer->check($_POST['id'], UPDATE);
    //Get the ocs server id associated with the machine
    $ocsservers_id = PluginOcsinventoryngOcsServer::getByMachineID($_POST["id"]);
    //Update the computer
    $cfg_ocs = PluginOcsinventoryngOcsServer::getConfig($ocsservers_id);
    $dohistory = isset($cfg_ocs['dohistory']) ? $cfg_ocs['dohistory'] : false;
    PluginOcsinventoryngOcsServer::updateComputer($_POST["resynch_id"], $ocsservers_id, $dohistory, 1);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $link = new PluginOcsinventoryngOcslink();
        $values["id"] = $_POST["link_id"];
        $values["use_auto_update"] = $_POST["use_auto_update"];
        $link->update($values);
        Html::back();
    } else {
开发者ID:pluginsGLPI,项目名称:ocsinventoryng,代码行数:31,代码来源:ocslink.form.php

示例2: Computer

the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Ocsinventoryng plugin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with ocsinventoryng. If not, see <http://www.gnu.org/licenses/>.
---------------------------------------------------------------------------------------------------------------------------------------------------- */
include '../../../inc/includes.php';
Session::checkRight("computer", "r");
if (isset($_POST["force_ocs_resynch"])) {
    $computer = new Computer();
    $computer->check($_POST['id'], 'w');
    //Get the ocs server id associated with the machine
    $ocsservers_id = PluginOcsinventoryngOcsServer::getByMachineID($_POST["id"]);
    //Update the computer
    PluginOcsinventoryngOcsServer::updateComputer($_POST["resynch_id"], $ocsservers_id, 1, 1);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $link = new PluginOcsinventoryngOcslink();
        $values["id"] = $_POST["link_id"];
        $values["use_auto_update"] = $_POST["use_auto_update"];
        $link->update($values);
        Html::back();
    } else {
        Html::displayErrorAndDie("lost");
    }
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:ocslink.form.php

示例3: Computer

*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("computer", READ);
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$computer = new Computer();
//Add a new computer
if (isset($_POST["add"])) {
    $computer->check(-1, CREATE, $_POST);
    if ($newID = $computer->add($_POST)) {
        Event::log($newID, "computers", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
        if ($_SESSION['glpibackcreated']) {
            Html::redirect($computer->getFormURL() . "?id=" . $newID);
        }
    }
    Html::back();
    // delete a computer
} else {
    if (isset($_POST["delete"])) {
        $computer->check($_POST['id'], DELETE);
        $ok = $computer->delete($_POST);
        if ($ok) {
            Event::log($_POST["id"], "computers", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        }
开发者ID:glpi-project,项目名称:glpi,代码行数:31,代码来源:computer.form.php

示例4: plugin_ocsinventoryng_unlockFields

/**
 *
 * Unlock fields managed by the plugin
 * @since 1.0
 * @param $_POST array
 */
function plugin_ocsinventoryng_unlockFields($params = array())
{
    $computer = new Computer();
    $computer->check($_POST['id'], 'w');
    if (isset($_POST["lockfield"]) && count($_POST["lockfield"])) {
        foreach ($_POST["lockfield"] as $key => $val) {
            PluginOcsinventoryngOcsServer::deleteInOcsArray($_POST["id"], $key, "computer_update");
        }
    }
}
开发者ID:geldarr,项目名称:hack-space,代码行数:16,代码来源:hook.php

示例5: Computer

*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("computer", "r");
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$computer = new Computer();
//Add a new computer
if (isset($_POST["add"])) {
    $computer->check(-1, 'w', $_POST);
    if ($newID = $computer->add($_POST)) {
        Event::log($newID, "computers", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    }
    Html::back();
    // delete a computer
} else {
    if (isset($_POST["delete"])) {
        $computer->check($_POST['id'], 'd');
        $ok = $computer->delete($_POST);
        if ($ok) {
            Event::log($_POST["id"], "computers", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        }
        $computer->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:computer.form.php

示例6: Computer

if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["sort"])) {
    $_GET["sort"] = "";
}
if (!isset($_GET["order"])) {
    $_GET["order"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$computer = new Computer();
//Add a new computer
if (isset($_POST["add"])) {
    $computer->check(-1, 'w', $_POST);
    if ($newID = $computer->add($_POST)) {
        Event::log($newID, "computers", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . ".");
    }
    glpi_header($_SERVER['HTTP_REFERER']);
    // delete a computer
} else {
    if (isset($_POST["delete"])) {
        $computer->check($_POST['id'], 'd');
        $ok = $computer->delete($_POST);
        if ($ok) {
            Event::log($_POST["id"], "computers", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22] . " " . $computer->getField('name'));
        }
        $computer->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:computer.form.php


注:本文中的Computer::check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。