本文整理汇总了PHP中DCL_Sanitize类的典型用法代码示例。如果您正苦于以下问题:PHP DCL_Sanitize类的具体用法?PHP DCL_Sanitize怎么用?PHP DCL_Sanitize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DCL_Sanitize类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DisplayForm
function DisplayForm($obj = '')
{
global $dcl_info, $g_oSec;
$isEdit = is_object($obj);
if (!$g_oSec->HasPerm(DCL_ENTITY_FAQQUESTION, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
return PrintPermissionDenied();
}
$t =& CreateSmarty();
$t->assign('IS_EDIT', $isEdit);
if ($isEdit) {
$t->assign('VAL_SEQ', $obj->seq);
$t->assign('VAL_QUESTIONTEXT', $obj->questiontext);
$t->assign('VAL_TOPICID', $obj->topicid);
$t->assign('VAL_QUESTIONID', $obj->questionid);
} else {
if (($id = DCL_Sanitize::ToInt($_REQUEST['topicid'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
$t->assign('VAL_SEQ', '');
$t->assign('VAL_QUESTIONTEXT', '');
$t->assign('VAL_TOPICID', $id);
}
SmartyDisplay($t, 'htmlFaqquestionsForm.tpl');
}
示例2: show
function show()
{
global $dcl_info, $g_oSec;
if (!$g_oSec->HasPerm(DCL_ENTITY_ADMIN, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$objPersonnel = CreateObject('dcl.htmlPersonnel');
$oDBPersonnel = CreateObject('dcl.dbPersonnel');
if ($oDBPersonnel->Load($GLOBALS['DCLID']) == -1) {
return;
}
$t =& CreateSmarty();
$oSelect = CreateObject('dcl.htmlSelect');
$t->assign('CMB_USERS', $objPersonnel->GetCombo(0, 'responsible', 'lastfirst', 0, false));
$begindate = @DCL_Sanitize::ToDate($_REQUEST['begindate']);
if ($begindate !== null) {
$t->assign('VAL_BEGINDATE', $begindate);
} else {
$t->assign('VAL_BEGINDATE', '');
}
$enddate = @DCL_Sanitize::ToDate($_REQUEST['enddate']);
if ($enddate !== null) {
$t->assign('VAL_ENDDATE', $enddate);
} else {
$t->assign('VAL_ENDDATE', '');
}
SmartyDisplay($t, 'htmlSecAuditBrowse.tpl');
}
示例3: _SetActionFormOptions
function _SetActionFormOptions()
{
global $g_oSec;
$aLinks = array();
if (($product_id = DCL_Sanitize::ToInt($_REQUEST['product_id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCTMODULE, DCL_PERM_ADD)) {
$aLinks[STR_CMMN_NEW] = menuLink('', 'menuAction=htmlProductModules.add&product_id=' . $product_id);
}
if ($g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW)) {
$aLinks['Detail'] = menuLink('', 'menuAction=boProducts.view&id=' . $product_id);
}
$this->_SetVar('hActionLinkSetLinks', '');
$bFirst = true;
foreach ($aLinks as $sText => $sLink) {
if ($bFirst) {
$bFirst = false;
} else {
$this->Template->parse('hActionLinkSetLinks', 'actionLinkSetSep', true);
}
$this->_SetVar('LNK_ACTIONVALUE', $sLink);
$this->_SetVar('VAL_ACTIONVALUE', $sText);
$this->Template->parse('hActionLinkSetLinks', 'actionLinkSetLink', true);
}
$this->Template->parse('hActionLinkSet', 'actionLinkSet');
$this->Template->parse('hActions', 'actions');
}
示例4: ShowPage
function ShowPage($sPage)
{
global $g_oSec, $dcl_info;
commonHeader();
if (($productid = DCL_Sanitize::ToInt($_REQUEST['id'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
if (!$g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEW, $productid)) {
return PrintPermissionDenied();
}
$this->oProduct =& CreateObject('dcl.dbProducts');
if ($this->oProduct->Load($productid) == -1) {
trigger_error('Could not find a product with an id of ' . $productid, E_USER_ERROR);
return;
}
$this->oSmarty->assign('VAL_ID', $this->oProduct->id);
$this->oSmarty->assign('VAL_NAME', $this->oProduct->name);
$this->oSmarty->assign('PERM_VIEWWO', $g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_VIEW));
$this->oSmarty->assign('PERM_VIEWTCK', $g_oSec->HasPerm(DCL_ENTITY_TICKET, DCL_PERM_VIEW));
$this->oSmarty->assign('PERM_WIKI', $dcl_info['DCL_WIKI_ENABLED'] == 'Y' && $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_VIEWWIKI));
$this->oSmarty->assign('PERM_EDIT', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_MODIFY));
$this->oSmarty->assign('PERM_DELETE', $g_oSec->HasPerm(DCL_ENTITY_PRODUCT, DCL_PERM_DELETE));
$this->oSmarty->assign('PERM_VERSIONS', $dcl_info['DCL_BUILD_MANAGER_ENABLED'] == 'Y' && $this->oProduct->is_versioned == 'Y');
SmartyDisplay($this->oSmarty, $sPage);
}
示例5: DisplayForm
function DisplayForm($obj = '')
{
global $dcl_info, $g_oSec;
$isEdit = is_object($obj);
if (!$g_oSec->HasPerm(DCL_ENTITY_FAQTOPIC, $isEdit ? DCL_PERM_MODIFY : DCL_PERM_ADD)) {
return PrintPermissionDenied();
}
$t =& CreateSmarty();
$t->assign('IS_EDIT', $isEdit);
if ($isEdit) {
$t->assign('VAL_SEQ', $obj->seq);
$t->assign('VAL_NAME', $obj->name);
$t->assign('VAL_DESCRIPTION', $obj->description);
$t->assign('VAL_FAQID', $obj->faqid);
$t->assign('VAL_TOPICID', $obj->topicid);
} else {
if (($id = DCL_Sanitize::ToInt($_REQUEST['faqid'])) === null) {
trigger_error('Data sanitize failed.');
return;
}
$t->assign('TXT_TITLE', STR_FAQ_ADDFAQTOPIC);
$t->assign('VAL_SEQ', '');
$t->assign('VAL_NAME', '');
$t->assign('VAL_DESCRIPTION', '');
$t->assign('VAL_FAQID', $id);
}
SmartyDisplay($t, 'htmlFaqtopicsForm.tpl');
}
示例6: ListVersions
function ListVersions()
{
// FIXME: application/x-javascript for Opera
header('Content-Type: application/json');
$product_id = @DCL_Sanitize::ToInt($_REQUEST['product_id']);
if ($product_id === null) {
exit;
}
$oDB = CreateObject('dcl.dbProductVersion');
$aOptions = $oDB->GetOptions('product_version_id', 'product_version_text', 'active', isset($_REQUEST['active']) && $_REQUEST['active'] == 'Y', '', "product_id={$product_id}");
$bFirst = true;
echo '{';
echo '"totalRecords":', count($aOptions), ',';
echo '"data":[';
for ($i = 0; $i < count($aOptions); $i++) {
if ($i > 0) {
echo ',';
}
echo '{';
echo '"id":', $aOptions[$i]['product_version_id'], ',';
echo '"text":"', str_replace('"', '\\"', str_replace("\\", "\\\\", $aOptions[$i]['product_version_text'])), '"';
echo '}';
}
echo ']}';
exit;
}
示例7: ListMainContacts
function ListMainContacts($org_id)
{
if (($org_id = DCL_Sanitize::ToInt($org_id)) === null) {
return;
}
$sSQL = "SELECT DISTINCT C.last_name, C.first_name, C.contact_id\n\t\t\t\tFROM dcl_contact C \n\t\t\t\t" . $this->JoinKeyword . " dcl_contact_type_xref CTX ON C.contact_id = CTX.contact_id \n\t\t\t\t" . $this->JoinKeyword . " dcl_contact_type CT ON CTX.contact_type_id = CT.contact_type_id\n\t\t\t\t" . $this->JoinKeyword . " dcl_org_contact OC ON C.contact_id = OC.contact_id \n\t\t\t\tWHERE OC.org_id = {$org_id}\n\t\t\t\tAND CT.contact_type_is_main = 'Y' \n\t\t\t\tORDER BY C.last_name, C.first_name, C.contact_id";
$this->Query($sSQL);
}
示例8: HasChecklists
function HasChecklists($id)
{
if (($id = DCL_Sanitize::ToInt($id)) == NULL) {
trigger_error('Data sanitize failed.');
return;
}
return $this->ExecuteScalar('select count(*) from dcl_chklst where dcl_chklst_tpl_id = ' . $id) > 0;
}
示例9: submitModify
function submitModify()
{
global $g_oSession, $dcl_info, $g_oSec;
if (!$g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY)) {
return PrintPermissionDenied();
}
$bHasChanges = false;
$o = CreateObject('dcl.dbPreferences');
$o->personnel_id = $GLOBALS['DCLID'];
$o->preferences_data = $g_oSession->Value('dcl_preferences');
if (!isset($o->preferences_data) || !is_array($o->preferences_data) || count($o->preferences_data) < 1) {
$o->preferences_data = array('DCL_PREF_TEMPLATE_SET' => $dcl_info['DCL_DEF_TEMPLATE_SET'], 'DCL_PREF_LANGUAGE' => $dcl_info['DCL_DEFAULT_LANGUAGE'], 'DCL_PREF_NOTIFY_DEFAULT' => 'N', 'DCL_PREF_CREATED_WATCH_OPTION' => 4);
$o->Add();
$bHasChanges = true;
}
$sOldTpl = $o->preferences_data['DCL_PREF_TEMPLATE_SET'];
foreach ($_REQUEST as $pref => $setting) {
if (substr($pref, 0, 9) != 'DCL_PREF_') {
continue;
}
if ($pref == 'DCL_PREF_NOTIFY_DEFAULT') {
$setting = DCL_Sanitize::ToYN($_REQUEST['DCL_PREF_NOTIFY_DEFAULT']);
}
if ($o->Value($pref) != $setting) {
$bHasChanges = true;
$o->Register($pref, $setting);
}
}
if (!isset($_REQUEST['DCL_PREF_NOTIFY_DEFAULT'])) {
$bHasChanges = true;
$o->Register('DCL_PREF_NOTIFY_DEFAULT', 'N');
}
if ($bHasChanges) {
$o->Edit();
$g_oSession->Register('dcl_preferences', $o->preferences_data);
$g_oSession->Edit();
}
// Template change?
$sNewTpl = $o->preferences_data['DCL_PREF_TEMPLATE_SET'];
if ($sNewTpl != $sOldTpl) {
// Do we need to break out of frames?
$menuAction = 'menuAction=htmlPreferences.modify';
$sNewIsFramed = file_exists(DCL_ROOT . 'templates/' . $sNewTpl . '/frameset.php');
$sOldIsFramed = file_exists(DCL_ROOT . 'templates/' . $sOldTpl . '/frameset.php');
if ($sOldIsFramed) {
if ($sNewIsFramed) {
RefreshTop(menuLink(DCL_WWW_ROOT . 'templates/' . $sNewTpl . '/frameset.php', $menuAction));
} else {
RefreshTop(menuLink('', $menuAction));
}
} else {
if ($sNewIsFramed) {
RefreshTop(menuLink(DCL_WWW_ROOT . 'templates/' . $sNewTpl . '/frameset.php', $menuAction));
}
}
}
$this->modify();
}
示例10: modify
function modify($aSource)
{
$aSource['active'] = @DCL_Sanitize::ToYN($aSource['active']);
parent::modify($aSource);
$oWSP = CreateObject('dcl.dbWorkspaceProduct');
$oWSP->serialize($aSource['workspace_id'], $aSource['products'], false);
$oWSU = CreateObject('dcl.dbWorkspaceUser');
$oWSU->serialize($this->oDB->workspace_id, $aSource['users'], false);
}
示例11: ListByOrg
function ListByOrg($org_id)
{
if (($org_id = DCL_Sanitize::ToInt($org_id)) === null) {
trigger_error('Data sanitize failed.');
return -1;
}
$sql = 'SELECT ' . $this->SelectAllColumns() . ' FROM ' . $this->TableName . ' WHERE org_id = ' . $org_id;
return $this->Query($sql);
}
示例12: HasSpecificRole
function HasSpecificRole($role_id)
{
// Checks the current user for specific role - should only be used by custom plugins
if (($role_id = DCL_Sanitize::ToInt($role_id)) === null) {
trigger_error('Data sanitize failed.');
return false;
}
$oDB =& CreateObject('dcl.dbUserRole');
return $oDB->HasSpecificRole($GLOBALS['DCLID'], $role_id);
}
示例13: GetPrimaryPhone
function GetPrimaryPhone($iOrgID)
{
if (($iOrgID = DCL_Sanitize::ToInt($iOrgID)) === null) {
trigger_error('Data sanitize failed.');
return -1;
}
if ($this->Query("SELECT pt.phone_type_name, p.phone_number FROM dcl_org_phone p, dcl_phone_type pt WHERE p.phone_type_id = pt.phone_type_id AND p.org_id = {$iOrgID} AND preferred = 'Y'") != -1) {
return $this->next_record();
}
return false;
}
示例14: ListByContact
function ListByContact($contact_id)
{
if (($contact_id = DCL_Sanitize::ToInt($contact_id)) === null) {
trigger_error('Data sanitize failed.');
return -1;
}
$sql = 'SELECT a.contact_addr_id, a.contact_id, a.addr_type_id, a.add1, a.add2, a.city, a.state, a.zip, a.country, a.preferred, t.addr_type_name';
$sql .= ' FROM ' . $this->TableName . ' a, dcl_addr_type t WHERE a.contact_id = ' . $contact_id . ' AND t.addr_type_id = a.addr_type_id';
$sql .= ' ORDER BY t.addr_type_name';
return $this->Query($sql);
}
示例15: ListByOrg
function ListByOrg($org_id)
{
if (($org_id = DCL_Sanitize::ToInt($org_id)) === null) {
trigger_error('Data sanitize failed.');
return -1;
}
$sql = 'SELECT p.id, op.org_id, p.name';
$sql .= ' FROM dcl_org_product_xref op, products p WHERE op.org_id = ' . $org_id . ' AND p.id = op.product_id';
$sql .= ' ORDER BY p.name';
return $this->Query($sql);
}