當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OpenVBX::getCurrentUser方法代碼示例

本文整理匯總了PHP中OpenVBX::getCurrentUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP OpenVBX::getCurrentUser方法的具體用法?PHP OpenVBX::getCurrentUser怎麽用?PHP OpenVBX::getCurrentUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenVBX的用法示例。


在下文中一共展示了OpenVBX::getCurrentUser方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_greeting

 private function get_greeting()
 {
     $user = OpenVBX::getCurrentUser();
     $voicemail_value = $user->voicemail;
     $json['mode'] = '';
     $json['play'] = '';
     $json['say'] = '';
     if (!empty($voicemail_value)) {
         if (preg_match('/^http/i', $voicemail_value) || preg_match('/^vbx-audio-upload/i', $voicemail_value)) {
             $json['mode'] = 'play';
             $json['play'] = $voicemail_value;
             if (preg_match('/^vbx-audio-upload:\\/\\/(.*)/i', $voicemail_value, $matches)) {
                 // This is a locally hosted file, and we need to return the correct
                 // absolute URL for the file.
                 $json['play'] = real_site_url("audio-uploads/" . $matches[1]);
             }
         } else {
             $json['mode'] = 'say';
             $json['say'] = $voicemail_value;
         }
     }
     $data['json'] = $json;
     if ($this->response_type != 'json') {
         return redirect('voicemail');
     }
     $this->respond('', 'voicemail/greeting', $data);
 }
開發者ID:JeffaCubed,項目名稱:OpenVBX,代碼行數:27,代碼來源:voicemail.php

示例2: getClient

 public function getClient()
 {
     $client = false;
     foreach (OpenVBX::getCurrentUser()->devices as $device) {
         if ('client:' == substr($device->value, 0, strlen('client:'))) {
             $client = $device->value;
             break;
         }
     }
     if (!$client) {
         throw new Exception('could not find client');
     }
     return $client;
 }
開發者ID:HighTechTorres,項目名稱:TwilioCookbook,代碼行數:14,代碼來源:Tester.class.php

示例3: header

<?php

$user = OpenVBX::getCurrentUser();
$tenant_id = $user->values['tenant_id'];
if (isset($_POST['id'])) {
    $flows = OpenVBX::getFlows(array('id' => $_POST['id'], 'tenant_id' => $tenant_id));
    $data = $flows[0]->values['data'];
    $sms_data = $flows[0]->values['sms_data'];
    $export = md5($data . $sms_data) . ':' . base64_encode($data) . ':' . base64_encode($sms_data);
    if (isset($_POST['file'])) {
        header('Content-type: text/plain');
        header('Content-Disposition: attachment; filename=' . preg_replace('/\\W/', '', $flows[0]->values['name']) . '.ovbx');
        echo $export;
        die;
    }
}
$flows = OpenVBX::getFlows(array('tenant_id' => $tenant_id));
?>
<style>
	.vbx-export-flow form {
		margin-top: 20px;
	}
	.vbx-export-flow p {
		margin: 10px 0;
		padding: 0 20px;
	}
	.vbx-export-flow h3 {
		font-size: 14px;
		padding: 0 20px;
		margin-top: 20px;
	}
開發者ID:n4t3,項目名稱:OpenVBX-Plugin-Export-4176930374-,代碼行數:31,代碼來源:export.php

示例4: foreach

			<ul class="user-groups-menu vbx-menu-items-right">
				<li class="menu-item"><button id="button-add-user" class="inline-button add-button"><span>Add User</span></button></li>
				<li class="menu-item"><button id="button-add-group" class="inline-button add-button"><span>Add Group</span></button></li>
			</ul>
		</div><!-- .vbx-content-menu -->
			
		<div class="yui-ge accounts-section">
			<div class="yui-u first">	

				<div id="user-container">
				<h3>Users</h3>
				<p>Drag a user into a group to add them.</p>

				<ul class="user-list">
				<?php 
$admin = OpenVBX::getCurrentUser();
?>
				<?php 
if (isset($users)) {
    $default_avatar = asset_url('assets/i/user-icon.png');
    foreach ($users as $user) {
        ?>
				<li class="user" rel="<?php 
        echo $user->id;
        ?>
">
					<div class="user-utilities">
						<img class="gravatar" src="<?php 
        if ($gravatars) {
            echo gravatar_url($user->email, 30, $default_avatar);
        } else {
開發者ID:ryanlarrabure,項目名稱:OpenVBX,代碼行數:31,代碼來源:accounts.php


注:本文中的OpenVBX::getCurrentUser方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。