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


PHP CContact::clearUpdateKey方法代码示例

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


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

示例1: CContact

require_once W2P_BASE_DIR . '/classes/ui.class.php';
$AppUI = new w2p_Core_CAppUI();
$updatekey = w2PgetParam($_POST, 'updatekey', 0);
$contact_id = (int) CContact::getContactByUpdatekey($updatekey);
if (!$contact_id) {
    echo $AppUI->_('You are not authorized to use this page. If you should be authorized please contact the sender to give you another valid link, thank you.');
    exit;
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
    $msg = $AppUI->_('There was an error recording your contact data, please contact the system administrator. Thank you very much.');
} else {
    $result = $contact->store();
    if (is_array($result)) {
        $msg = $AppUI->_('There was an error recording your contact data, please contact the system administrator. Thank you very much.');
    } else {
        $custom_fields = new w2p_Core_CustomFields('contacts', 'addedit', $contact->contact_id, 'edit', 1);
        $custom_fields->bind($_POST);
        $custom_fields->store($contact->contact_id);
        $contact->clearUpdateKey();
        $msg = $AppUI->_('Your contact data has been recorded successfully. Your may now close your browser window.  Thank you very much, ' . $contact->contact_first_name);
    }
}
?>
<html>
	<body>
		<?php 
echo $msg;
?>
	</body>
</html>
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: testClearUpdateKey

 public function testClearUpdateKey()
 {
     $contact = new CContact();
     $contact->load(1);
     $this->assertEquals('ASDFASDFASDF', $contact->contact_updatekey);
     $contact->clearUpdateKey();
     $this->assertEquals('', $contact->contact_updatekey);
     $contact = new CContact();
     $contact->contact_id = 1;
     $this->assertEquals('', $contact->getUpdateKey());
 }
开发者ID:eureka2,项目名称:web2project,代码行数:11,代码来源:contacts.test.php


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