Commit d2ba6492 authored by Michael Fürmann's avatar Michael Fürmann
Browse files

Added XMPP Users List and DB Table

parent 9f94a17e
......@@ -52,4 +52,30 @@ CREATE TABLE `xmpp_domain` (
PRIMARY KEY (`domain_id`),
KEY `server_id` (`server_id`,`domain`),
KEY `domain_active` (`domain`,`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
\ No newline at end of file
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Table structure for table `xmpp_user`
--
CREATE TABLE `xmpp_user` (
`xmppuser_id` int(11) unsigned NOT NULL auto_increment,
`sys_userid` int(11) unsigned NOT NULL default '0',
`sys_groupid` int(11) unsigned NOT NULL default '0',
`sys_perm_user` varchar(5) NOT NULL default '',
`sys_perm_group` varchar(5) NOT NULL default '',
`sys_perm_other` varchar(5) NOT NULL default '',
`server_id` int(11) unsigned NOT NULL default '0',
`xmpp_domain_id` int(11) unsigned NOT NULL default '0',
`login` varchar(255) NOT NULL default '',
`jid` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`is_domain_admin` enum('n','y') NOT NULL default 'n',
`is_muc_admin` enum('n','y') NOT NULL default 'n',
`active` enum('n','y') NOT NULL DEFAULT 'n',
PRIMARY KEY (`xmppuser_id`),
KEY `server_id` (`server_id`,`jid`),
KEY `jid_active` (`jid`,`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
\ No newline at end of file
......@@ -1964,7 +1964,7 @@ CREATE TABLE `web_traffic` (
-- --------------------------------------------------------
--
-- Table structure for table `xmpp_domain`
-- Table structure for table `xmpp_domain`
--
CREATE TABLE `xmpp_domain` (
......@@ -2008,6 +2008,33 @@ CREATE TABLE `xmpp_domain` (
KEY `domain_active` (`domain`,`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `xmpp_user`
--
CREATE TABLE `xmpp_user` (
`xmppuser_id` int(11) unsigned NOT NULL auto_increment,
`sys_userid` int(11) unsigned NOT NULL default '0',
`sys_groupid` int(11) unsigned NOT NULL default '0',
`sys_perm_user` varchar(5) NOT NULL default '',
`sys_perm_group` varchar(5) NOT NULL default '',
`sys_perm_other` varchar(5) NOT NULL default '',
`server_id` int(11) unsigned NOT NULL default '0',
`xmpp_domain_id` int(11) unsigned NOT NULL default '0',
`login` varchar(255) NOT NULL default '',
`jid` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`is_domain_admin` enum('n','y') NOT NULL default 'n',
`is_muc_admin` enum('n','y') NOT NULL default 'n',
`active` enum('n','y') NOT NULL DEFAULT 'n',
PRIMARY KEY (`xmppuser_id`),
KEY `server_id` (`server_id`,`jid`),
KEY `jid_active` (`jid`,`active`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
-- --------------------------------------------------------
-- --------------------------------------------------------
......
<?php
$wb["list_head_txt"] = 'XMPP User Accounts';
$wb["jid_txt"] = 'Jabber ID';
$wb["is_domain_admin_txt"] = 'Domain admin';
$wb["is_muc_admin_txt"] = 'MUC admin';
$wb["add_new_record_txt"] = 'Add new user';
$wb["active_txt"] = 'Active';
?>
\ No newline at end of file
......@@ -163,8 +163,8 @@ if($app->auth->get_client_limit($userid, 'xmppaccount') != 0)
{
$items[] = array( 'title' => 'XMPP Account',
'target' => 'content',
'link' => 'mail/xmpp_account_list.php',
'html_id' => 'xmpp_account_list');
'link' => 'mail/xmpp_user_list.php',
'html_id' => 'xmpp_user_list');
}
if(count($items))
......
<?php
/*
Datatypes:
- INTEGER
- DOUBLE
- CURRENCY
- VARCHAR
- TEXT
- DATE
*/
// Name of the list
$liste["name"] = "xmpp_user";
// Database table
$liste["table"] = "xmpp_user";
// Index index field of the database table
$liste["table_idx"] = "xmppuser_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
// Records per page
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "xmpp_user_list.php";
// Script file of the edit form
$liste["edit_file"] = "xmpp_user_edit.php";
// Script File of the delete script
$liste["delete_file"] = "xmpp_user_del.php";
// Paging Template
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "JID",
'datatype' => "VARCHAR",
'filters' => array( 0 => array( 'event' => 'SHOW',
'type' => 'IDNTOUTF8')
),
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "is_domain_admin",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('n' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'y' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
$liste["item"][] = array( 'field' => "is_muc_admin",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('n' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>", 'y' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
?>
<div class='page-header'>
<h1><tmpl_var name="list_head_txt"></h1>
</div>
<p><tmpl_var name="list_desc_txt"></p>
<tmpl_if name='datalog_changes_count' op='>' value='0'>
<div>
<div class="systemmonitor-state state-info">
<div class="status"></div>
<div class="statusMsg">
{tmpl_var name="datalog_changes_txt"}
<ul>
<tmpl_loop name="datalog_changes">
<li><strong>{tmpl_var name="text"}:</strong> {tmpl_var name="count"}</li>
</tmpl_loop>
</ul>
{tmpl_var name="datalog_changes_end_txt"}
</div>
</div><br />
</div>
</tmpl_if>
<p class="fieldset-legend">{tmpl_var name="toolsarea_head_txt"}</p>
<button class="btn btn-default formbutton-success" type="button" data-load-content="mail/xmpp_user_edit.php">{tmpl_var name="add_new_record_txt"}</button>
<p class="fieldset-legend"><tmpl_var name="list_head_txt"></p>
<div class="table-wrapper marginTop15">
<table class="table">
<thead class="dark form-group-sm">
<tr>
<th data-column="jid"><tmpl_var name="jid_txt"></th>
<th class="small-col" data-column="is_domain_admin"><tmpl_var name="is_domain_admin_txt"></th>
<th class="small-col" data-column="is_muc_admin"><tmpl_var name="is_muc_admin_txt"></th>
<th class="small-col text-right">{tmpl_var name='search_limit'}</th>
</tr>
<tr>
<td><input class="form-control" type="text" name="search_jid" value="{tmpl_var name='search_jid'}" /></td>
<td><select class="form-control" name="search_is_domain_admin">{tmpl_var name='search_is_domain_admin'}</select></td>
<td><select class="form-control" name="search_is_muc_admin">{tmpl_var name='search_is_muc_admin'}</select></td>
<td class="text-right">
<button type="button" class="btn btn-default formbutton-default formbutton-narrow" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" data-submit-form="pageForm" data-form-action="mail/xmpp_user_list.php"><span class="icon icon-filter"></span></button>
</td>
</tr>
</thead>
<tbody>
<tmpl_loop name="records">
<tr>
<td><a href="#" data-load-content="mail/xmpp_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="jid"}</a></td>
<td><a href="#" data-load-content="mail/xmpp_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="is_domain_admin"}</a></td>
<td><a href="#" data-load-content="mail/xmpp_user_edit.php?id={tmpl_var name='id'}">{tmpl_var name="is_muc_admin"}</a></td>
<td class="text-right">
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/xmpp_user_del.php?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></button>
</td>
</tr>
</tmpl_loop>
<tmpl_unless name="records">
<tr class="tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>">
<td colspan="4">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
</tr>
</tmpl_unless>
</tbody>
<tfoot>
<tr>
<td colspan="4"><tmpl_var name="paging"></td>
</tr>
</tfoot>
</table>
</div>
\ No newline at end of file
<?php
require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
/******************************************
* Begin Form configuration
******************************************/
$list_def_file = "list/xmpp_user.list.php";
/******************************************
* End Form configuration
******************************************/
//* Check permissions for module
$app->auth->check_module_permissions('mail');
$app->load('listform_actions');
class list_action extends listform_actions {
function onShow() {
global $app, $conf;
$app->uses('getconf');
$global_config = $app->getconf->get_global_config('xmpp');
parent::onShow();
}
}
$list = new list_action;
$list->SQLOrderBy = 'ORDER BY xmpp_user.jid';
$list->onLoad();
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment