Multilinguified.

This commit is contained in:
Nate Jones
2013-05-08 01:17:52 +00:00
parent 92634e8acb
commit c951615a97
7 changed files with 462 additions and 237 deletions

188
app/xmpp/app_languages.php Normal file
View File

@@ -0,0 +1,188 @@
<?php
//XMPP
$text['title-xmpp']['en-us'] = 'XMPP Manager';
$text['title-xmpp']['pt-pt'] = '';
$text['title-xmpp-edit']['en-us'] = 'Profile Edit';
$text['title-xmpp-edit']['pt-pt'] = '';
$text['title-xmpp-add']['en-us'] = 'Profile Add';
$text['title-xmpp-add']['pt-pt'] = '';
$text['header-xmpp']['en-us'] = 'XMPP Manager';
$text['header-xmpp']['pt-pt'] = '';
$text['header-xmpp-edit']['en-us'] = 'Profile Edit';
$text['header-xmpp-edit']['pt-pt'] = '';
$text['header-xmpp-add']['en-us'] = 'Profile Add';
$text['header-xmpp-add']['pt-pt'] = '';
$text['description-xmpp-list']['en-us'] = 'Utilizes the Jingle protocol. Jingle is an extension to the Jabber/XMPP protocol.';
$text['description-xmpp-list']['pt-pt'] = '';
$text['description-xmpp-edit-add']['en-us'] = 'Defines a connections to a Jabber, GTalk, or other XMPP Provider server.';
$text['description-xmpp-edit-add']['pt-pt'] = '';
$text['label-profile_name']['en-us'] = 'Profile Name';
$text['label-profile_name']['pt-pt'] = '';
$text['description-profile_name']['en-us'] = 'Enter the profile name here.';
$text['description-profile_name']['pt-pt'] = '';
$text['label-username']['en-us'] = 'Username';
$text['label-username']['pt-pt'] = '';
$text['description-username']['en-us'] = 'Enter the XMPP username here.';
$text['description-username']['pt-pt'] = '';
$text['label-password']['en-us'] = 'Password';
$text['label-password']['pt-pt'] = '';
$text['description-password']['en-us'] = 'Enter the password here.';
$text['description-password']['pt-pt'] = '';
$text['label-auto_login']['en-us'] = 'Auto-Login';
$text['label-auto_login']['pt-pt'] = '';
$text['description-auto_login']['en-us'] = 'Choose whether to automatically login.';
$text['description-auto_login']['pt-pt'] = '';
$text['label-xmpp_server']['en-us'] = 'XMPP Server';
$text['label-xmpp_server']['pt-pt'] = '';
$text['description-xmpp_server']['en-us'] = 'Enter the alternate XMPP server if not the same as specified in the Username field above (e.g. GoogleTalk is: talk.google.com).';
$text['description-xmpp_server']['pt-pt'] = '';
$text['label-default_exten']['en-us'] = 'Default Extension';
$text['label-default_exten']['pt-pt'] = '';
$text['description-default_exten']['en-us'] = 'Default extension (if one cannot be determined) .';
$text['description-default_exten']['pt-pt'] = '';
$text['label-context']['en-us'] = 'Context';
$text['label-context']['pt-pt'] = '';
$text['description-context']['en-us'] = 'Enter the context here.';
$text['description-context']['pt-pt'] = '';
$text['label-rtp_ip']['en-us'] = 'RTP IP';
$text['label-rtp_ip']['pt-pt'] = '';
$text['description-rtp_ip']['en-us'] = 'IP Address for RTP.';
$text['description-rtp_ip']['pt-pt'] = '';
$text['label-ext_rtp_ip']['en-us'] = 'External RTP IP';
$text['label-ext_rtp_ip']['pt-pt'] = '';
$text['description-ext_rtp_ip']['en-us'] = 'External IP Address for RTP.';
$text['description-ext_rtp_ip']['pt-pt'] = '';
$text['label-sasl_type']['en-us'] = 'SASL Type';
$text['label-sasl_type']['pt-pt'] = '';
$text['description-sasl_type']['en-us'] = 'Select an SASL type.';
$text['description-sasl_type']['pt-pt'] = '';
$text['label-tls_enable']['en-us'] = 'Enable TLS';
$text['label-tls_enable']['pt-pt'] = '';
$text['description-tls_enable']['en-us'] = 'Set the status of TLS support.';
$text['description-tls_enable']['pt-pt'] = '';
$text['label-use_rtp_timer']['en-us'] = 'Use RTP Timer';
$text['label-use_rtp_timer']['pt-pt'] = '';
$text['description-use_rtp_timer']['en-us'] = 'Disable to trade async for more calls.';
$text['description-use_rtp_timer']['pt-pt'] = '';
$text['label-vad']['en-us'] = 'Voice Activity Detection (VAD)';
$text['label-vad']['pt-pt'] = '';
$text['description-vad']['en-us'] = 'The direction for which VAD should be enabled.';
$text['description-vad']['pt-pt'] = '';
$text['option-vad_none']['en-us'] = 'None';
$text['option-vad_none']['pt-pt'] = '';
$text['option-vad_in']['en-us'] = 'In';
$text['option-vad_in']['pt-pt'] = '';
$text['option-vad_out']['en-us'] = 'Out';
$text['option-vad_out']['pt-pt'] = '';
$text['option-vad_both']['en-us'] = 'Both';
$text['option-vad_both']['pt-pt'] = '';
$text['label-candidate_acl']['en-us'] = 'Candidate ACL';
$text['label-candidate_acl']['pt-pt'] = '';
$text['description-candidate_acl']['en-us'] = 'Candidate access control list.';
$text['description-candidate_acl']['pt-pt'] = '';
$text['label-local_network_acl']['en-us'] = 'Local Network ACL';
$text['label-local_network_acl']['pt-pt'] = '';
$text['description-local_network_acl']['en-us'] = 'Local network access control list.';
$text['description-local_network_acl']['pt-pt'] = '';
$text['label-enabled']['en-us'] = 'Enabled';
$text['label-enabled']['pt-pt'] = '';
$text['description-enabled']['en-us'] = 'Set the current status of this profile.';
$text['description-enabled']['pt-pt'] = '';
$text['label-description']['en-us'] = 'Description';
$text['label-description']['pt-pt'] = '';
$text['description-description']['en-us'] = 'Enter the description for the Profile here (optional).';
$text['description-description']['pt-pt'] = '';
$text['label-status']['en-us'] = 'Status';
$text['label-status']['pt-pt'] = '';
$text['label-true']['en-us'] = 'True';
$text['label-true']['pt-pt'] = '';
$text['label-false']['en-us'] = 'False';
$text['label-false']['pt-pt'] = 'falso';
$text['button-add']['en-us'] = 'Add';
$text['button-add']['pt-pt'] = '';
$text['button-edit']['en-us'] = 'Edit';
$text['button-edit']['pt-pt'] = '';
$text['button-delete']['en-us'] = 'Delete';
$text['button-delete']['pt-pt'] = '';
$text['button-save']['en-us'] = 'Save';
$text['button-save']['pt-pt'] = 'Guardar';
$text['button-back']['en-us'] = 'Back';
$text['button-back']['pt-pt'] = 'Voltar';
$text['button-advanced']['en-us'] = 'Advanced';
$text['button-advanced']['pt-pt'] = '';
$text['label-advanced']['en-us'] = 'Show Advanced';
$text['label-advanced']['pt-pt'] = '';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['confirm-delete']['pt-pt'] = '';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-add']['pt-pt'] = '';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-update']['pt-pt'] = '';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-delete']['pt-pt'] = '';
$text['message-required']['en-us'] = 'Please provide: ';
$text['message-required']['pt-pt'] = '';
?>

View File

@@ -29,13 +29,19 @@ include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('xmpp_delete')) {
//access granted
//access granted
}
else {
echo "access denied";
exit;
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$domain_name = $_SESSION['domains'][$domain_uuid]['domain_name'];
@@ -64,7 +70,7 @@ $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and xmpp_profile_uuid = '$profile_id' ";
$db->exec(check_sql($sql));
$filename = $_SESSION['switch']['conf']['dir'] . "/jingle_profiles/" . "v_" . $domain_name . "_" .
$filename = $_SESSION['switch']['conf']['dir'] . "/jingle_profiles/" . "v_" . $domain_name . "_" .
preg_replace("/[^A-Za-z0-9]/", "", $profile['profile_name']) . "_" . $profile_id . ".xml";
unlink($filename);
@@ -85,6 +91,8 @@ if ($fp) {
fclose($fp);
}
$action = "delete";
include "update_complete.php";
//show the footer

View File

@@ -26,256 +26,264 @@ function hide_advanced_config() {
<br>
<form method='post' name='ifrm' action=''>
<div align='center'>
<table width='100%' border='0' cellpadding='6' cellspacing='0'>
<tr>
<td colspan='2'>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align='left' width="50%">
<strong>Profile Edit</strong><br>
</td> <td width='50%' align='right'>
<input type='submit' name='submit' class='btn' value='Save'>
<!-- <input type='button' class='btn' name='' alt='copy' onclick="if (confirm('Do you really want to copy this?')){window.location='v_gateways_copy.php?id=1';}" value='Copy'> -->
<input type='button' class='btn' name='' alt='back' onclick="window.location='xmpp.php'" value='Back'>
</td>
<div align='center'>
<table width='100%' border='0' cellpadding='6' cellspacing='0'>
<tr>
<td colspan='2'>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align='left' width="50%">
<strong>
<?
if ($action == "update") {
echo $text['header-xmpp-edit'];
}
else if ($action == "add") {
echo $text['header-xmpp-add'];
}
?>
</strong><br>
</td> <td width='50%' align='right'>
<input type='submit' name='submit' class='btn' value='<?=$text['button-save']?>'>
<input type='button' class='btn' name='' alt='back' onclick="window.location='xmpp.php'" value='<?=$text['button-back']?>'>
</td>
</tr>
<tr>
<td align='left' colspan='2'>
Defines a connections to a Jabber, GTalk, or other XMPP Provider server. <br />
</td>
</tr>
</table>
<td align='left' colspan='2'>
<?=$text['description-xmpp-edit-add']?><br />
</td>
</tr>
</table>
<br />
</td>
</td>
</tr>
<tr>
<td width="30%" class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Profile Name:
</td>
<td width="70%" class='vtable' align='left'>
<input class='formfld' type='text' name='profile_name' maxlength='255' value="<?php echo $profile['profile_name']; ?>">
<br />
Enter the profile name here.
</td>
<tr>
<td width="30%" class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-profile_name']?>:
</td>
<td width="70%" class='vtable' align='left'>
<input class='formfld' type='text' name='profile_name' maxlength='255' value="<?php echo $profile['profile_name']; ?>">
<br />
<?=$text['description-profile_name']?>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Username:
<?=$text['label-username']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='profile_username' autocomplete='off' maxlength='255' value="<?php echo $profile['profile_username'];?>">
<br />
Enter the XMPP username here.
<?=$text['description-username']?>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Password:
<?=$text['label-password']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='password' name='profile_password' autocomplete='off' id='profile_password' maxlength='50' onfocus="document.getElementById('show_profile_password').innerHTML = 'Password: '+document.getElementById('profile_password').value;" value="<?php echo $profile['profile_password'];?>">
<input class='formfld' type='password' name='profile_password' autocomplete='off' id='profile_password' maxlength='50' onfocus="document.getElementById('show_profile_password').innerHTML = '<?=$text['label-password']?>: '+document.getElementById('profile_password').value;" value="<?php echo $profile['profile_password'];?>">
<br />
<span onclick="document.getElementById('show_profile_password').innerHTML = ''">Enter the password here. </span><span id='show_profile_password'></span>
<span onclick="document.getElementById('show_profile_password').innerHTML = ''"><?=$text['description-password']?> </span><span id='show_profile_password'></span>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Auto-Login:
<?=$text['label-auto_login']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='auto_login'>
<option value='true' <?php if($profile['auto_login'] == "true") echo "selected='selected'"; ?>>true</option>
<option value='false' <?php if($profile['auto_login'] == "false") echo "selected='selected'"; ?>>false</option>
<option value='true' <?php if($profile['auto_login'] == "true") echo "selected='selected'"; ?>><?=$text['label-true']?></option>
<option value='false' <?php if($profile['auto_login'] == "false") echo "selected='selected'"; ?>><?=$text['label-false']?></option>
</select>
<br />
Choose whether to automatically login.
</td>
</tr>
<tr>
<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>
XMPP Server:
</td>
<td width='70%' class='vtable' align='left'>
<input class='formfld' type='text' name='xmpp_server' maxlength='255' value="<?php echo $profile['xmpp_server'];?>">
<br />
Enter alternate XMPP server if the server is not the same as the one in the Username<br />
Example GoogleTalk is: talk.google.com
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Default Extension:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='default_exten' maxlength='255' value="<?php echo $profile['default_exten'];?>">
<br />
Default extension (if one cannot be determined)
<?=$text['description-auto_login']?>
</td>
</tr>
<tr>
<td style='padding: 0px;' colspan='2' class='' valign='top' align='left' nowrap='nowrap'>
<div id="show_advanced_box">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="30%" valign="top" class="vncell">Show Advanced</td>
<td width="70%" class="vtable">
<input type="button" onClick="show_advanced_config()" value="Advanced"></input>
</td>
<td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-xmpp_server']?>:
</td>
<td width='70%' class='vtable' align='left'>
<input class='formfld' type='text' name='xmpp_server' maxlength='255' value="<?php echo $profile['xmpp_server'];?>">
<br />
<?=$text['description-xmpp_server']?>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-default_exten']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='default_exten' maxlength='255' value="<?php echo $profile['default_exten'];?>">
<br />
<?=$text['description-default_exten']?>
</td>
</tr>
<tr>
<td style='padding: 0px;' colspan='2' class='' valign='top' align='left' nowrap='nowrap'>
<div id="show_advanced_box">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="30%" valign="top" class="vncell"><?=$text['label-advanced']?></td>
<td width="70%" class="vtable">
<input type="button" onClick="show_advanced_config()" value="<?=$text['button-advanced']?>"></input>
</td>
</tr>
</table>
</table>
</div>
<div id="show_advanced" style="display:none">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<div id="show_advanced" style="display:none">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<?php if (if_group("superadmin")) { ?>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Context:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='context' maxlength='255' value="<?php echo $profile['context'];?>">
<br />
Enter the context here.
</td>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-context']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='context' maxlength='255' value="<?php echo $profile['context'];?>">
<br />
<?=$text['description-context']?>
</td>
</tr>
<?php } ?>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
RTP IP:
</td>
<td class='vtable' align='left'>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-rtp_ip']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='rtp_ip' maxlength='255' value="<?php echo $profile['rtp_ip'];?>">
<br />
IP Address for RTP
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Ext RTP IP:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='ext_rtp_ip' maxlength='255' value="<?php echo $profile['ext_rtp_ip'];?>">
<br />
External IP Address for RTP
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
SASL Type:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='sasl_type'>
<option value='plain' <?php if($profile['sasl_type'] == "plain") echo "selected='selected'"; ?>>plain</option>
<option value='md5' <?php if($profile['sasl_type'] == "md5") echo "selected='selected'"; ?>>md5</option>
</select>
<br />
Choose SASL Type. Plain or MD5
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Enable TLS:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='tls_enable'>
<option value='true' <?php if($profile['tls_enable'] == "true") echo "selected='selected'"; ?>>true</option>
<option value='false' <?php if($profile['tls_enable'] == "false") echo "selected='selected'"; ?>>false</option>
</select>
<br />
Enable TLS or not
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Use RTP Timer
</td>
<td class='vtable' align='left'>
<select class='formfld' name='use_rtp_timer'>
<option value='true' <?php if($profile['use_rtp_timer'] == "true") echo "selected='selected'"; ?>>true</option>
<option value='false' <?php if($profile['use_rtp_timer'] == "false") echo "selected='selected'"; ?>>false</option>
</select>
<br />
Disable to trade async for more calls
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Voice Activity Detection
</td>
<td class='vtable' align='left'>
<select class='formfld' name='vad'>
<option value='none' <?php if($profile['vad'] == "none") echo "selected='selected'"; ?>>none</option>
<option value='in' <?php if($profile['vad'] == "in") echo "selected='selected'"; ?>>in</option>
<option value='out' <?php if($profile['vad'] == "out") echo "selected='selected'"; ?>>out</option>
<option value='both' <?php if($profile['vad'] == "both") echo "selected='selected'"; ?>>both</option>
</select>
<br />
Which direction are we doing VAD?
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Candidate ACL
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='candidate_acl' maxlength='255' value="<?php echo $profile['candidate_acl'];?>">
<br />
Candidate access control list
<?=$text['description-rtp_ip']?>
</td>
</tr>
<tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-ext_rtp_ip']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='ext_rtp_ip' maxlength='255' value="<?php echo $profile['ext_rtp_ip'];?>">
<br />
<?=$text['description-ext_rtp_ip']?>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-sasl_type']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='sasl_type'>
<option value='plain' <?php if($profile['sasl_type'] == "plain") echo "selected='selected'"; ?>>Plain</option>
<option value='md5' <?php if($profile['sasl_type'] == "md5") echo "selected='selected'"; ?>>MD5</option>
</select>
<br />
<?=$text['description-sasl_type']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Local Network ACL
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='local_network_acl' maxlength='255' value="<?php echo $profile['local_network_acl'];?>">
<br />
Local network access control list
</td>
</tr>
</table>
<?=$text['label-tls_enable']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='tls_enable'>
<option value='true' <?php if($profile['tls_enable'] == "true") echo "selected='selected'"; ?>><?=$text['label-true']?></option>
<option value='false' <?php if($profile['tls_enable'] == "false") echo "selected='selected'"; ?>><?=$text['label-false']?></option>
</select>
<br />
<?=$text['description-tls_enable']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-use_rtp_timer']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='use_rtp_timer'>
<option value='true' <?php if($profile['use_rtp_timer'] == "true") echo "selected='selected'"; ?>><?=$text['label-true']?></option>
<option value='false' <?php if($profile['use_rtp_timer'] == "false") echo "selected='selected'"; ?>><?=$text['label-false']?></option>
</select>
<br />
<?=$text['description-use_rtp_timer']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-vad']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='vad'>
<option value='none' <?php if($profile['vad'] == "none") echo "selected='selected'"; ?>><?=$text['option-vad_none']?></option>
<option value='in' <?php if($profile['vad'] == "in") echo "selected='selected'"; ?>><?=$text['option-vad_in']?></option>
<option value='out' <?php if($profile['vad'] == "out") echo "selected='selected'"; ?>><?=$text['option-vad_out']?></option>
<option value='both' <?php if($profile['vad'] == "both") echo "selected='selected'"; ?>><?=$text['option-vad_both']?></option>
</select>
<br />
<?=$text['description-vad']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-candidate_acl']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='candidate_acl' maxlength='255' value="<?php echo $profile['candidate_acl'];?>">
<br />
<?=$text['description-candidate_acl']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-local_network_acl']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='local_network_acl' maxlength='255' value="<?php echo $profile['local_network_acl'];?>">
<br />
<?=$text['description-local_network_acl']?>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
Enabled:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='enabled'>
<option value='true' <?php if($profile['enabled'] == "true") echo "selected='selected'"; ?>>true</option>
<option value='false' <?php if($profile['enabled'] == "false") echo "selected='selected'"; ?>>false</option>
</select>
<br />
</td>
</tr>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
Profile Description:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='description' value='<?php echo $profile['description'];?>'>
<br />
Enter the description of the Profile here.
</td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='hidden' name='profile_id' value='<?php echo $profile['xmpp_profile_uuid']; ?>'>
<input type='submit' name='submit' class='btn' value='Save'>
</td>
<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-enabled']?>:
</td>
<td class='vtable' align='left'>
<select class='formfld' name='enabled'>
<option value='true' <?php if($profile['enabled'] == "true") echo "selected='selected'"; ?>><?=$text['label-true']?></option>
<option value='false' <?php if($profile['enabled'] == "false") echo "selected='selected'"; ?>><?=$text['label-false']?></option>
</select>
<br />
<?=$text['description-enabled']?>
</td>
</tr>
<tr>
<td class='vncell' valign='top' align='left' nowrap='nowrap'>
<?=$text['label-description']?>:
</td>
<td class='vtable' align='left'>
<input class='formfld' type='text' name='description' value='<?php echo $profile['description'];?>'>
<br />
<?=$text['description-description']?>
</td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='hidden' name='profile_id' value='<?php echo $profile['xmpp_profile_uuid']; ?>'>
<input type='submit' name='submit' class='btn' value='<?=$text['button-save']?>'>
</td>
</tr>
</table>
</form>

View File

@@ -2,8 +2,8 @@
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td align='left'><b>XMPP Manager</b><br>
Utilizes the Jingle protocol. Jingle is an extension to the Jabber/XMPP protocol.
<td align='left'><b><?=$text['header-xmpp']?></b><br>
<?=$text['description-xmpp-list']?>
</td>
</tr>
</table>
@@ -11,14 +11,14 @@
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<th>Profile</th>
<th>Context</th>
<th>Status</th>
<th>Enabled</th>
<th>Description</th>
<th><?=$text['label-profile_name']?></th>
<th><?=$text['label-context']?></th>
<th><?=$text['label-status']?></th>
<th><?=$text['label-enabled']?></th>
<th><?=$text['label-description']?></th>
<td align='right' width='42'>
<?php if (permission_exists('xmpp_add')) { ?>
<a href='xmpp_profile_edit.php' alt='add'><?php echo $v_link_label_add; ?></a>
<a href='xmpp_profile_edit.php' alt='<?=$text['button-add']?>'><?php echo $v_link_label_add; ?></a>
<?php } ?>
</td>
</tr>
@@ -38,11 +38,11 @@ foreach($profiles_array as $profile){
<td class='<?php echo $row_style[$c]; ?>'><?php echo $profile['description']; ?>&nbsp;</td>
<td align='right' width='42'>
<?php if (permission_exists('xmpp_edit')) { ?>
<a href='xmpp_profile_edit.php?id=<?php echo $profile['xmpp_profile_uuid']; ?>' alt='edit'><?php echo $v_link_label_edit; ?></a>
<a href='xmpp_profile_edit.php?id=<?php echo $profile['xmpp_profile_uuid']; ?>' alt='<?=$text['button-edit']?>'><?php echo $v_link_label_edit; ?></a>
<?php } ?>
<?php if (permission_exists('xmpp_delete')) { ?>
<a href='profile_delete.php?id=<?php echo $profile['xmpp_profile_uuid']; ?>' onclick="return confirm('Do you really want to delete this?')"
alt='delete'><?php echo $v_link_label_delete; ?></a>
<a href='profile_delete.php?id=<?php echo $profile['xmpp_profile_uuid']; ?>' onclick="return confirm('<?=$text['confirm-delete']?>')"
alt='<?=$text['button-delete']?>'><?php echo $v_link_label_delete; ?></a>
<?php } ?>
</td>
</tr>
@@ -53,7 +53,7 @@ if ($c==0) { $c=1; } else { $c=0; }
<tr>
<td colspan='6' align='right' width='42'>
<?php if (permission_exists('xmpp_add')) { ?>
<a href='xmpp_profile_edit.php' alt='add'><?php echo $v_link_label_add; ?></a>
<a href='xmpp_profile_edit.php' alt='<?=$text['button-add']?>'><?php echo $v_link_label_add; ?></a>
<?php } ?>
</td>
</tr>

View File

@@ -1,11 +1,10 @@
<meta http-equiv="refresh" content="2;url=xmpp.php">
<div align='center'>
<?php
if ($action == "add") {
echo "Add Complete\n";
}
if ($action == "update") {
echo "Edit Complete\n";
<?php
switch ($action) {
case "add" : echo $text['message-add']."\n"; break;
case "update" : echo $text['message-update']."\n"; break;
case "delete" : echo $text['message-delete']."\n"; break;
}
?>
</div>

View File

@@ -35,7 +35,16 @@ else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$page["title"] = $text['title-xmpp'];
require_once "includes/paging.php";
//connect to event socket

View File

@@ -38,18 +38,30 @@ else {
exit;
}
require_once "includes/header.php";
$domain_name = $_SESSION['domains'][$_SESSION['domain_uuid']]['domain_name'];
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//add or update the database
if (isset($_REQUEST["id"])) {
$action = "update";
$profile_id = check_str($_REQUEST["id"]);
} else {
} else {
$action = "add";
}
require_once "includes/header.php";
if ($action == "update") {
$page["title"] = $text['title-xmpp-edit'];
}
else if ($action == "add") {
$page["title"] = $text['title-xmpp-add'];
}
$domain_name = $_SESSION['domains'][$_SESSION['domain_uuid']]['domain_name'];
if ($action == "update") {
$sql = "";
$sql .= "select * from v_xmpp ";
@@ -83,9 +95,9 @@ if ($action == "update") {
$profile['local_network_acl'] = "localnet.auto";
}
if ((!isset($_REQUEST['submit'])) || ($_REQUEST['submit'] != 'Save')) {
if ((!isset($_REQUEST['submit'])) || ($_REQUEST['submit'] != $text['button-save'])) {
// If we arent saving a Profile Display the form.
include "profile_edit.php";
include "profile_edit.php";
require_once "includes/footer.php";
exit;
}
@@ -94,16 +106,17 @@ foreach ($_REQUEST as $field => $data){
$request[$field] = check_str($data);
}
// check the data
$error = "";
if (strlen($request['profile_name']) < 1) $error .= "Profile name is a Required Field<br />\n";
if (strlen($request['profile_username']) < 1) $error .= "Username is a Required Field<br />\n";
if (strlen($request['profile_password']) < 1) $error .= "Password is a Required Field<br />\n";
if (strlen($request['default_exten']) < 1) $error .= "Default Extension is a Required Field<br />\n";
if (strlen($error) > 0) {
if (strlen($request['profile_name']) < 1) $error .= $text['message-required'].$text['label-profile_name']."<br />\n";
if (strlen($request['profile_username']) < 1) $error .= $text['message-required'].$text['label-username']."<br />\n";
if (strlen($request['profile_password']) < 1) $error .= $text['message-required'].$text['label-password']."<br />\n";
if (strlen($request['default_exten']) < 1) $error .= $text['message-required'].$text['label-default_exten']."<br />\n";
if (strlen($error) > 0) {
include "errors.php";
$profile = $request;
include "profile_edit.php";
include "profile_edit.php";
require_once "includes/footer.php";
exit;
}
@@ -164,7 +177,7 @@ if ($action == "add" && permission_exists('xmpp_add')) {
$sql .= ") ";
$db->exec(check_sql($sql));
}
}
elseif ($action == "update" && permission_exists('xmpp_edit')) {
$sql = "";
$sql .= "UPDATE v_xmpp SET ";
@@ -195,7 +208,7 @@ elseif ($action == "update" && permission_exists('xmpp_edit')) {
$sql .= "where xmpp_profile_uuid = '" . $request['id'] . "' ";
$db->exec(check_sql($sql));
$xmpp_profile_uuid = $request['id'];
}
}
if ($request['enabled'] == "true") {
//prepare the xml