本文整理汇总了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 {
示例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");
}
示例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"]));
}
示例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");
}
}
}
示例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"])) {
示例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"])) {