• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CContact类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Import

 /**
  * @param int $iUserId
  * @param string $sTempFileName
  * @param int $iParsedCount
  * @return int
  */
 public function Import($iUserId, $sTempFileName, &$iParsedCount)
 {
     $iCount = -1;
     $iParsedCount = 0;
     if (file_exists($sTempFileName)) {
         $aCsv = api_Utils::CsvToArray($sTempFileName);
         if (is_array($aCsv)) {
             $iCount = 0;
             foreach ($aCsv as $aCsvItem) {
                 set_time_limit(30);
                 $this->oParser->Reset();
                 $oContact = new CContact();
                 $oContact->IdUser = $iUserId;
                 $this->oParser->SetContainer($aCsvItem);
                 $aParameters = $this->oParser->GetParameters();
                 foreach ($aParameters as $sPropertyName => $mValue) {
                     if ($oContact->IsProperty($sPropertyName)) {
                         $oContact->{$sPropertyName} = $mValue;
                     }
                 }
                 if (0 === strlen($oContact->FullName)) {
                     $oContact->FullName = trim($oContact->FirstName . ' ' . $oContact->LastName);
                 }
                 $iParsedCount++;
                 $oContact->__SKIP_VALIDATE__ = true;
                 if ($this->oApiContactsManager->CreateContact($oContact)) {
                     $iCount++;
                 }
                 unset($oContact, $aParameters, $aCsvItem);
             }
         }
     }
     return $iCount;
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:40,代码来源:csv.php


示例2: testStoreCreate

 /**
  * Tests the proper creation of a user & contact
  */
 public function testStoreCreate()
 {
     $this->obj->bind($this->post_data);
     $result = $this->obj->store();
     $contact = new CContact();
     $contact->overrideDatabase($this->mockDB);
     $contact->bind($this->post_data);
     $result = $contact->store();
     $this->assertTrue($result);
     $this->assertNotEquals(0, $contact->contact_id);
     $this->obj->user_contact = $contact->contact_id;
     $result = $this->obj->store();
     $this->assertTrue($result);
     $this->assertNotEquals(0, $this->obj->user_id);
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:18,代码来源:CUsersTest.php


示例3: addField

 public function addField($fieldName, $fieldValue)
 {
     if ('' == $fieldValue) {
         return '-';
     }
     $pieces = explode('_', $fieldName);
     $suffix = end($pieces);
     switch ($suffix) {
         case 'datetime':
             $myDate = intval($fieldValue) ? new w2p_Utilities_Date($this->AppUI->formatTZAwareTime($fieldValue, '%Y-%m-%d %T')) : null;
             $output = $myDate ? $myDate->format($this->dtf) : '-';
             break;
         case 'email':
             $output = w2p_email($fieldValue);
             break;
         case 'url':
             $value = str_replace(array('"', '"', '<', '>'), '', $fieldValue);
             $output = w2p_url($value);
             break;
         case 'owner':
             if (!$fieldValue) {
                 return '-';
             }
             $obj = new CContact();
             $obj->findContactByUserid($fieldValue);
             $link = '?m=users&a=view&user_id=' . $fieldValue;
             $output = '<a href="' . $link . '">' . $obj->contact_display_name . '</a>';
             break;
         case 'percent':
             $output = round($fieldValue) . '%';
             break;
         case 'description':
             $output = w2p_textarea($fieldValue);
             break;
         case 'company':
         case 'department':
         case 'project':
             $class = 'C' . ucfirst($suffix);
             $obj = new $class();
             $obj->load($fieldValue);
             $link = '?m=' . w2p_pluralize($suffix) . '&a=view&' . $suffix . '_id=' . $fieldValue;
             $output = '<a href="' . $link . '">' . $obj->{"{$suffix}" . '_name'} . '</a>';
             break;
         default:
             $output = htmlspecialchars($fieldValue, ENT_QUOTES);
     }
     return $output;
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:48,代码来源:ViewHelper.class.php


示例4: Import

 /**
  * @param int $iUserId
  * @param string $sTempFileName
  * @param int $iParsedCount
  * @param int $iGroupId
  * @param bool $bIsShared
  * @return int
  */
 public function Import($iUserId, $sTempFileName, &$iParsedCount, $iGroupId, $bIsShared)
 {
     $iCount = -1;
     $iParsedCount = 0;
     if (file_exists($sTempFileName)) {
         $aCsv = api_Utils::CsvToArray($sTempFileName);
         if (is_array($aCsv)) {
             $oApiUsersManager = CApi::Manager('users');
             $oAccount = $oApiUsersManager->GetDefaultAccount($iUserId);
             $iCount = 0;
             foreach ($aCsv as $aCsvItem) {
                 set_time_limit(30);
                 $this->oParser->Reset();
                 $oContact = new CContact();
                 $oContact->IdUser = $iUserId;
                 $this->oParser->SetContainer($aCsvItem);
                 $aParameters = $this->oParser->GetParameters();
                 foreach ($aParameters as $sPropertyName => $mValue) {
                     if ($oContact->IsProperty($sPropertyName)) {
                         $oContact->{$sPropertyName} = $mValue;
                     }
                 }
                 if (0 === strlen($oContact->FullName)) {
                     $oContact->FullName = trim($oContact->FirstName . ' ' . $oContact->LastName);
                 }
                 if (0 !== strlen($oContact->HomeEmail)) {
                     $oContact->PrimaryEmail = \EPrimaryEmailType::Home;
                     $oContact->ViewEmail = $oContact->HomeEmail;
                 } else {
                     if (0 !== strlen($oContact->BusinessEmail)) {
                         $oContact->PrimaryEmail = \EPrimaryEmailType::Business;
                         $oContact->ViewEmail = $oContact->BusinessEmail;
                     } else {
                         if (0 !== strlen($oContact->OtherEmail)) {
                             $oContact->PrimaryEmail = \EPrimaryEmailType::Other;
                             $oContact->ViewEmail = $oContact->OtherEmail;
                         }
                     }
                 }
                 if (strlen($oContact->BirthdayYear) === 2) {
                     $oDt = DateTime::createFromFormat('y', $oContact->BirthdayYear);
                     $oContact->BirthdayYear = $oDt->format('Y');
                 }
                 $iParsedCount++;
                 $oContact->__SKIP_VALIDATE__ = true;
                 if ($oAccount) {
                     $oContact->IdDomain = $oAccount->IdDomain;
                     $oContact->IdTenant = $oAccount->IdTenant;
                 }
                 $oContact->SharedToAll = $bIsShared;
                 $oContact->GroupsIds = array($iGroupId);
                 if ($this->oApiContactsManager->CreateContact($oContact)) {
                     $iCount++;
                 }
                 unset($oContact, $aParameters, $aCsvItem);
             }
         }
     }
     return $iCount;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:68,代码来源:csv.php


示例5: getContactByWhere

 /**
  * @param string $sWhere
  * @param bool $bIgnoreHideInGab = false
  * @param int $iSharedTenantId = null
  * @return string
  */
 protected function getContactByWhere($sWhere, $bIgnoreHideInGab = false, $iSharedTenantId = null)
 {
     $aMap = api_AContainer::DbReadKeys(CContact::GetStaticMap());
     $aMap = array_map(array($this, 'escapeColumn'), $aMap);
     $sShared = is_int($iSharedTenantId) ? 'AND shared_to_all = 1' : 'AND shared_to_all = 0';
     $sHideInGab = $bIgnoreHideInGab ? '' : ' AND hide_in_gab = 0';
     $sSql = 'SELECT %s FROM %sawm_addr_book WHERE deleted = 0 AND auto_create = 0 ' . $sShared . $sHideInGab . ' AND %s';
     return sprintf($sSql, implode(', ', $aMap), $this->Prefix(), $sWhere);
 }
开发者ID:hallnewman,项目名称:webmail-lite,代码行数:15,代码来源:command_creator.php


示例6: testLoad

 public function testLoad()
 {
     $this->obj->bind($this->post_data);
     $result = $this->obj->store();
     $this->assertTrue($result);
     $item = new CContact();
     $item->overrideDatabase($this->mockDB);
     $this->post_data['contact_id'] = $this->obj->contact_id;
     $this->mockDB->stageHash($this->post_data);
     $item->load($this->obj->contact_id);
     $this->assertEquals($this->obj->contact_first_name, $item->contact_first_name);
     $this->assertEquals($this->obj->contact_last_name, $item->contact_last_name);
     $this->assertEquals($this->obj->contact_display_name, $item->contact_display_name);
     $this->assertEquals($this->obj->contact_company, $item->contact_company);
     $this->assertEquals($this->obj->contact_department, $item->contact_department);
     $this->assertEquals($this->obj->contact_icon, $item->contact_icon);
     $this->assertEquals($this->obj->contact_owner, $item->contact_owner);
     $this->assertEquals($this->obj->contact_id, $item->contact_id);
 }
开发者ID:,项目名称:,代码行数:19,代码来源:


示例7: isset

<?php

/* ADMIN $Id: do_user_aed.php,v 1.13 2005/03/11 00:46:46 gregorerhardt Exp $ */
include $AppUI->getModuleClass('contacts');
$del = isset($_REQUEST['del']) ? $_REQUEST['del'] : FALSE;
$obj = new CUser();
$contact = new CContact();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('User');
// !User's contact information not deleted - left for history.
if ($del) {
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("deleted", UI_MSG_ALERT, true);
        $AppUI->redirect('', -1);
    }
    return;
}
$isNewUser = !$_REQUEST['user_id'];
if ($isNewUser) {
    // check if a user with the param Username already exists
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:do_user_aed.php


示例8: CUser

                $contact->contact_private = 1;
                $contact->store();
            }
        }
    } else {
        $AppUI->setMsg('failed to delete role', UI_MSG_ERROR);
    }
} else {
    if ($user_role) {
        $public_contact = false;
        if (dPgetConfig('user_contact_activate') && !$perms->checkLogin($user_id)) {
            $public_contact = true;
        }
        if ($perms->insertUserRole($user_role, $user_id)) {
            $AppUI->setMsg('added', UI_MSG_OK, true);
            if ($public_contact) {
                // Mark contact as public
                $obj = new CUser();
                $contact = new CContact();
                $obj->load($user_id);
                if ($contact->load($obj->user_contact)) {
                    $contact->contact_private = 0;
                    $contact->store();
                }
            }
        } else {
            $AppUI->setMsg('failed to add role', UI_MSG_ERROR);
        }
    }
}
$AppUI->redirect();
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:31,代码来源:do_userrole_aed.php


示例9: elseif

    $AppUI->setState('UserIdxWhere', '');
} elseif (isset($_POST['search_string'])) {
    $AppUI->setState('UserIdxWhere', $_POST['search_string']);
    $AppUI->setState('UserIdxStub', '');
}
$stub = $AppUI->getState('UserIdxStub');
$where = $AppUI->getState('UserIdxWhere');
$where = w2PformSafe($where, true);
if (isset($_GET['orderby'])) {
    $AppUI->setState('UserIdxOrderby', w2PgetParam($_GET, 'orderby', null));
}
$orderby = $AppUI->getState('UserIdxOrderby') ? $AppUI->getState('UserIdxOrderby') : 'user_username';
$orderby = $tab == 3 || $orderby != 'date_time_in' && $orderby != 'user_ip' ? $orderby : 'user_username';
// Pull First Letters
$letters = CUser::getFirstLetters();
$letters = $letters . CContact::getFirstLetters($AppUI->user_id, true);
$a2z = '<a href="./index.php?m=users&stub=0">' . $AppUI->_('All') . '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
for ($c = 65; $c < 91; $c++) {
    $cu = chr($c);
    $cell = !(mb_strpos($letters, $cu) === false) ? '<a href="?m=users&stub=' . $cu . '">' . $cu . '</a>' : '<font color="#999999">' . $cu . '</font>';
    $a2z .= $cell . '&nbsp;';
}
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('User Management', 'icon.png', $m);
$titleBlock->addSearchCell($where);
$titleBlock->addCell($a2z);
$titleBlock->addButton('New user', '?m=users&a=addedit');
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
<?php 
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:index.php


示例10: header

    }
} else {
    header('Location: newuser.php?msg=spam');
}
if (w2PgetConfig('activate_external_user_creation') != 'true') {
    die('You should not access this file directly');
}
$username = w2PgetParam($_POST, 'user_username', 0);
$username = preg_replace("/[^A-Za-z0-9]/", "", $username);
$user = new CAdmin_User();
$result = $user->loadAll(null, "user_username = '{$username}'");
if (count($result)) {
    header('Location: newuser.php?msg=existing-user');
}
$email = w2PgetParam($_POST, 'contact_email', 0);
$contact = new CContact();
$result = $contact->loadAll(null, "contact_email = '{$email}'");
if (count($result)) {
    header('Location: newuser.php?msg=existing-email');
}
if (!$user->bind($_POST)) {
    $AppUI->setMsg($user->getError(), UI_MSG_ERROR);
    header('Location: newuser.php?msg=user');
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    header('Location: newuser.php?msg=contact');
}
$result = $contact->store();
if (count($contact->getError())) {
    header('Location: newuser.php?msg=contact');
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:do_user_aed.php


示例11: isset

}
$del = isset($_REQUEST['del']) ? w2PgetParam($_REQUEST, 'del', false) : false;
$notify_new_user = isset($_POST['notify_new_user']) ? $_POST['notify_new_user'] : 0;
$perms =& $AppUI->acl();
if (!$perms->checkModule('admin', 'edit')) {
    $AppUI->redirect('m=public&a=access_denied');
}
if (!$perms->checkModule('users', 'edit')) {
    $AppUI->redirect('m=public&a=access_denied');
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Roles');
if ($_REQUEST['user_id']) {
    $user = new CUser();
    $user->load($_REQUEST['user_id']);
    $contact = new CContact();
    $contact->load($user->user_contact);
}
if ($del) {
    if ($perms->deleteUserRole(w2PgetParam($_REQUEST, 'role_id', 0), w2PgetParam($_REQUEST, 'user_id', 0))) {
        $AppUI->setMsg('deleted', UI_MSG_ALERT, true);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg('failed to delete role', UI_MSG_ERROR);
        $AppUI->redirect();
    }
    return;
}
if (isset($_REQUEST['user_role']) && $_REQUEST['user_role']) {
    if ($perms->insertUserRole($_REQUEST['user_role'], $_REQUEST['user_id'])) {
        if ($notify_new_user) {
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:do_userrole_aed.php


示例12: die

<?php

/* CONTACTS $Id: view.php 6200 2013-01-15 06:24:08Z ajdonnison $ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$contact_id = intval(dPgetParam($_GET, 'contact_id', 0));
$AppUI->savePlace();
// load the record data
$msg = '';
$row = new CContact();
$canDelete = $row->canDelete($msg, $contact_id);
// Don't allow to delete contacts, that have a user associated to them.
$q = new DBQuery();
$q->addTable('users');
$q->addQuery('user_id');
$q->addWhere('user_contact = ' . $contact_id);
$sql = $q->prepare();
$q->clear();
$tmp_user = db_loadResult($sql);
if (!empty($tmp_user)) {
    $canDelete = false;
}
$canEdit = getPermission($m, 'edit', $contact_id);
if (!$row->load($contact_id) && $contact_id > 0) {
    $AppUI->setMsg('Contact');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    if ($row->contact_private && $row->contact_owner != $AppUI->user_id && $row->contact_owner && $contact_id != 0) {
        $AppUI->redirect('m=public&a=access_denied');
开发者ID:222elm,项目名称:dotprojectFrame,代码行数:31,代码来源:view.php


示例13: canEdit

// check permissions for this record
$canEdit = canEdit('system');
// Check permissions
if (!$canEdit && $user_id != $AppUI->user_id) {
    $AppUI->redirect('m=public&a=access_denied');
}
// load the preferences
$q = new w2p_Database_Query();
$q->addTable('user_preferences');
$q->addQuery('pref_name, pref_value');
$q->addWhere('pref_user = ' . (int) $user_id);
$prefs = $q->loadHashList();
$q->clear();
// get the user name
if ($user_id) {
    $user = CContact::getContactByUserid($user_id);
} else {
    $user = 'Default';
}
$titleBlock = new w2p_Theme_TitleBlock('Edit User Preferences', 'myevo-weather.png', $m, $m . '.' . $a);
$perms =& $AppUI->acl();
if ($canEdit) {
    $titleBlock->addCrumb('?m=system', 'system admin');
    $titleBlock->addCrumb('?m=system&a=systemconfig', 'system configuration');
}
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
function submitIt() {
	var form = document.changeuser;
	// Collate the checked states of the task log stuff
开发者ID:,项目名称:,代码行数:31,代码来源:


示例14: afterWriteContent

 function afterWriteContent($path, \Sabre\DAV\IFile $node)
 {
     if ($node instanceof \Sabre\CardDAV\ICard) {
         $iUserId = $this->server->getUser();
         if (isset($iUserId)) {
             $iTenantId = $node instanceof \Afterlogic\DAV\CardDAV\SharedCard ? 0 : null;
             $sContactFileName = $node->getName();
             $oContactDb = $this->oApiContactsManager->getContactByStrId($iUserId, $sContactFileName, $iTenantId);
             if (!isset($oContactDb)) {
                 $oVCard = \Sabre\VObject\Reader::read($node->get(), \Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES);
                 if ($oVCard && $oVCard->UID) {
                     $oContactDb = $this->oApiContactsManager->getContactByStrId($iUserId, (string) $oVCard->UID . '.vcf', $iTenantId);
                 }
             }
             $oContact = new \CContact();
             $oContact->InitFromVCardStr($iUserId, $node->get());
             $oContact->IdContactStr = $sContactFileName;
             $oContact->IdTenant = $iTenantId;
             if (isset($oContactDb)) {
                 $oContact->IdContact = $oContactDb->IdContact;
                 $oContact->IdDomain = $oContactDb->IdDomain;
                 $oContact->SharedToAll = !!$oContactDb->SharedToAll;
                 $this->oApiContactsManager->updateContact($oContact);
             } else {
                 $this->oApiContactsManager->createContact($oContact);
             }
         }
     }
 }
开发者ID:afterlogic,项目名称:dav,代码行数:29,代码来源:Plugin.php


示例15: intval

echo $AppUI->_($message_id ? 'Edit Message' : 'Add Message');
?>
</strong></th>
        </tr>
        <?php 
if ($message_parent >= 0) {
    //check if this is a reply-post; if so, printout the original message
    $date = intval($message->message_date) ? new w2p_Utilities_Date($message->message_date) : new w2p_Utilities_Date();
    ?>
            <tr>
                <td align="right"><?php 
    echo $AppUI->_('Author');
    ?>
:</td>
                <td align="left"><?php 
    echo CContact::getContactByUserid($message->message_author);
    ?>
 (<?php 
    echo $AppUI->formatTZAwareTime($message->message_date, $df . ' ' . $tf);
    ?>
)</td>
            </tr>
            <tr><td align="right"><?php 
    echo $AppUI->_('Subject');
    ?>
:</td><td align="left"><?php 
    echo $message->message_title;
    ?>
</td></tr>
            <tr><td align="right" valign="top"><?php 
    echo $AppUI->_('Message');
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:post_message.php


示例16: isset

</strong>
            </th>
        </tr>
        <?php 
if ($message_parent >= 0) {
    //check if this is a reply-post; if so, printout the original message
    $messageAuthor = isset($message->message_author) ? $message->message_author : $AppUI->user_id;
    $date = intval($message->message_date) ? new w2p_Utilities_Date($message->message_date) : new w2p_Utilities_Date();
    ?>
            <tr>
                <td align="right"><?php 
    $form->showLabel('Author');
    ?>
</td>
                <td align="left"><?php 
    echo CContact::getContactByUserid($messageAuthor);
    ?>
 (<?php 
    echo $AppUI->formatTZAwareTime($message->message_date, $df . ' ' . $tf);
    ?>
)</td>
            </tr>
            <tr><td align="right"><?php 
    $form->showLabel('Subject');
    ?>
</td>
                <td align="left"><?php 
    echo $message->message_title;
    ?>
</td></tr>
            <tr><td align="right" valign="top"><?php 
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:post_message.php


示例17: getContactById

 /**
  * @param int $iUserId
  * @param mixed $mContactId
  * @return CContact | false
  */
 public function getContactById($iUserId, $mContactId)
 {
     $oContact = false;
     if ($this->init($iUserId)) {
         $oContactItem = $this->getItem($iUserId, \afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME, $mContactId);
         if ($oContactItem) {
             $sVCardData = $oContactItem['data'];
             if ($sVCardData) {
                 $oContact = new CContact();
                 $oContact->InitFromVCardStr($iUserId, $sVCardData);
                 $oContact->IdContact = $mContactId;
                 $oContact->ETag = $oContactItem['etag'];
             }
         }
     }
     return $oContact;
 }
开发者ID:pkdevboxy,项目名称:webmail-lite,代码行数:22,代码来源:storage.php


示例18: createsqluser

 public function createsqluser($username, $password, $ldap_attribs = array())
 {
     global $AppUI;
     $hash_pass = MD5($password);
     if (!count($ldap_attribs) == 0) {
         // Contact information based on the inetOrgPerson class schema
         $c = new CContact();
         $c->contact_first_name = $ldap_attribs['givenname'][0];
         $c->contact_last_name = $ldap_attribs['sn'][0];
         $c->contact_city = $ldap_attribs['l'][0];
         $c->contact_country = $ldap_attribs['country'][0];
         $c->contact_state = $ldap_attribs['st'][0];
         $c->contact_zip = $ldap_attribs['postalcode'][0];
         $c->contact_job = $ldap_attribs['title'][0];
         $c->contact_email = $ldap_attribs['mail'][0];
         $c->contact_phone = $ldap_attribs['telephonenumber'][0];
         $c->contact_owner = $AppUI->user_id;
         $c->store();
         $contactArray = array('phone_mobile' => $ldap_attribs['mobile'][0]);
         $c->setContactMethods($contactArray);
     }
     $contact_id = $c->contact_id == null ? 'NULL' : $c->contact_id;
     $u = new CUser();
     $u->user_username = $username;
     $u->user_password = $hash_pass;
     $u->user_type = 0;
     // Changed from 1 (administrator) to 0 (Default user)
     $u->user_contact = (int) $contact_id;
     $u->store();
     $user_id = $u->user_id;
     $this->user_id = $user_id;
     $acl =& $AppUI->acl();
     $acl->insertUserRole($acl->get_group_id('anon'), $this->user_id);
 }
开发者ID:,项目名称:,代码行数:34,代码来源:


示例19: Contact_Vcard_Parse

// check whether vCard file should be fetched from source or parsed for vCardKeys; criteria: get parameters
if (isset($_FILES['vcf']) && isset($_GET['suppressHeaders']) && $_GET['suppressHeaders'] == 'true') {
    //parse and store vCard file
    $vcf = $_FILES['vcf'];
    // include PEAR vCard class
    require_once $AppUI->getLibraryClass('PEAR/Contact_Vcard_Parse');
    if (is_uploaded_file($vcf['tmp_name'])) {
        // instantiate a parser object
        $parse = new Contact_Vcard_Parse();
        // parse a vCard file and store the data
        // in $cardinfo
        $cardinfo = $parse->fromFile($vcf['tmp_name']);
        // store the card info array
        foreach ($cardinfo as $ci) {
            //one file can contain multiple vCards
            $obj = new CContact();
            //transform the card info array to dP store format
            $contactValues["contact_last_name"] = $ci['N'][0]['value'][0][0];
            $contactValues["contact_first_name"] = $ci['N'][0]['value'][1][0];
            $contactValues["contact_title"] = $ci['N'][0]['value'][3][0];
            $contactValues["contact_birthday"] = $ci['BDAY'][0]['value'][0][0];
            $contactValues["contact_company"] = $ci['UID'][0]['value'][0][0];
            $contactValues["contact_type"] = $ci['N'][0]['value'][2][0];
            $contactValues["contact_email"] = $ci['EMAIL'][0]['value'][0][0];
            $contactValues["contact_email2"] = $ci['EMAIL'][1]['value'][0][0];
            $contactValues["contact_phone"] = $ci['TEL'][0]['value'][0][0];
            $contactValues["contact_phone2"] = $ci['TEL'][1]['value'][0][0];
            $contactValues["contact_mobile"] = $ci['TEL'][2]['value'][0][0];
            $contactValues["contact_address1"] = $ci['ADR'][0]['value'][2][0];
            $contactValues["contact_address2"] = $ci['ADR'][0]['value'][1][0] . ', ' . $ci['ORG'][0]['value'][0][0];
            $contactValues["contact_city"] = $ci['ADR'][0]['value'][3][0];
开发者ID:n2i,项目名称:xvnkb,代码行数:31,代码来源:vcardimport.php


示例20: die

<?php

/* $Id: do_user_aed.php 1866 2011-05-01 06:20:10Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/admin/do_user_aed.php $ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$del = (int) w2PgetParam($_POST, 'del', 0);
$obj = new CUser();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$action = $del ? 'deleted' : 'stored';
$contact_id = (int) w2PgetParam($_POST, 'contact_id', 0);
$user_id = (int) w2PgetParam($_POST, 'user_id', 0);
$isNewUser = !$user_id;
$perms =& $AppUI->acl();
if ($del) {
} elseif ($isNewUser) {
    if (!canAdd('admin')) {
        $AppUI->redirect('m=public&a=access_denied');
    }
    if (!canAdd('users')) {
        $AppUI->redirect('m=public&a=access_denied');
    }
} else {
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:do_user_aed.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CController类代码示例发布时间:2022-05-23
下一篇:
PHP CConsultation类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap