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); }
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; }
<?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; }
<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 {