} function SRVFormat($domain) { global $c; switch (@$_REQUEST['srv_format']) { case 'dnsmasq': return 'srv_host=_ischedules._tcp.' . $domain . ',' . ($c->scheduling_dkim_domain ? $c->scheduling_dkim_domain : $_SERVER['SERVER_NAME']) . ',' . $_SERVER['SERVER_PORT']; case 'bind': //_http._tcp.example.com. IN SRV 0 5 80 www.example.com. return '_ischedules._tcp.' . $domain . '. IN SRV 0 5 ' . $_SERVER['SERVER_PORT'] . ' ' . ($c->scheduling_dkim_domain ? $c->scheduling_dkim_domain : $_SERVER['SERVER_NAME']); default: return '_ischedules._tcp.' . $domain . ' ' . ($c->scheduling_dkim_domain ? $c->scheduling_dkim_domain : $_SERVER['SERVER_NAME']) . ' ' . $_SERVER['SERVER_PORT']; } } $browser = new Browser(translate('iSchedule Domains')); $browser->AddColumn("domain", translate('Domain'), 'left', ''); // function AddColumn( $field, $header="", $align="", $format="", $sql="", $class="", $datatype="", $hook=null ) { $browser->AddColumn("srvok", translate('SRV Record'), 'right', '', "''", '', '', 'SRVOk'); $browser->SetJoins("usr "); $browser->SetWhere(" email is not null and email <> ''"); $browser->SetDistinct(" split_part(email,'@',2) as "); $sql = "select distinct split_part(email,'@',2) as domain from usr where email is not null and email <> ''"; $page_elements[] = $browser; $c->stylesheets[] = 'css/edit.css'; include "page-header.php"; /** * Page elements could be an array of viewers, browsers or something else * that supports the Render() method... or a non-object which we assume is * just a string of text that we echo. */ $heading_level = null;
function bindings_to_us_browser() { global $c, $page_elements, $id, $editor; $browser = new Browser(translate('Bindings to this Principal\'s Collections')); $browser->AddColumn('bind_id', translate('ID'), '', ''); $browser->AddHidden('b.dav_owner_id'); $browser->AddHidden('p.principal_id'); $browser->AddColumn('dav_name', translate('Collection'), '', '<td style="white-space:nowrap;">%s</td>', 'c.dav_name'); $browser->AddColumn('bound_as', translate('Bound As'), '', '<td style="white-space:nowrap;">%s</td>', 'b.dav_name'); $browser->AddColumn('access_ticket_id', translate('Ticket ID'), '', ''); $browser->AddColumn('privs', translate('Privileges'), '', '', "privileges_list(privileges)"); $delurl = $c->base_url . '/admin.php?action=edit&t=principal&id=##principal_id##&bind_id=##bind_id##&subaction=delete_binding'; $browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'"); $browser->SetOrdering('target', 'A'); $browser->SetJoins('dav_binding b LEFT JOIN collection c ON (bound_source_id=collection_id) LEFT JOIN access_ticket t ON (ticket_id=access_ticket_id) LEFT JOIN principal p USING(user_no)'); $browser->SetWhere('p.principal_id = ' . intval($editor->Value('principal_id'))); $browser->RowFormat('<tr class="r%d">', '</tr>', '#even'); $browser->DoQuery(); return $browser; }
foreach ($v as $k2 => $v2) { $public = $v2 == "on" ? "TRUE" : "FALSE"; $in_menu = $show_in_menu[$k][$k2] == "on" ? "TRUE" : "FALSE"; $k2dec = urldecode($k2); $session->Dbg("SavedSearches", "Submitted query_is_public[{$k}][{$k2dec}] is >>{$v2}<< and show_in_menu[{$k}][{$k2dec}] is >>%s<<", $show_in_menu[$k][$k2]); $sql .= "UPDATE saved_queries SET public = {$public} , in_menu = {$in_menu} WHERE user_no = {$k} AND query_name = " . qpg($k2dec) . ";"; } } } $qry = new PgQuery($sql); $qry->Exec("SavedSearches"); } $debuggroups["querystring"] = 1; $browser = new Browser("Your Saved Searches"); if ($session->AllowedTo("Admin") || $session->AllowedTo("Support")) { $browser->AddColumn('user_no', 'User#', 'center', '<a href="/user.php?user_no=##user_no##">%d</a>'); } else { $browser->AddHidden('user_no'); } $browser->AddColumn('query_name', 'Query Name', 'left', '<a href="/wrsearch.php?style=plain&saved_query=##URL:query_name##">%s</a>'); $browser->AddColumn('query_type', 'Type', 'center', '%s'); // $browser->AddColumn( 'query_sql', 'SQL', 'left', '%s' ); // $browser->AddColumn( 'query_params', 'Params', 'left', '%s' ); $browser->AddColumn('maxresults', 'Max#', 'left', '%s'); $browser->AddColumn('rlsort', 'SortBy', 'center', '%s'); $browser->AddColumn('rlseq', 'Up/Dn', 'center', '%s'); $browser->AddColumn('updated', 'Last Modified', 'center', '%-16.16s'); $browser->AddColumn('public_checkbox', 'Public?', '', '<td class="center"><input name="query_is_public[##user_no##][##URL:query_name##]" value="off" type="hidden"><input name="query_is_public[##user_no##][##URL:query_name##]" class="fcheckbox" type="checkbox"%s></td>', "CASE WHEN public THEN ' checked' ELSE '' END"); $browser->AddColumn('menu_checkbox', 'Menu?', '', '<td class="center"><input name="show_in_menu[##user_no##][##URL:query_name##]" value="off" type="hidden"><input name="show_in_menu[##user_no##][##URL:query_name##]" class="fcheckbox" type="checkbox"%s></td>', "CASE WHEN in_menu THEN ' checked' ELSE '' END"); $browser->AddColumn('query_params', 'Actions', 'center', '<a href="/wrsearch.php?saved_query=##URL:query_name##" class="submit">Edit Query</a>'); $browser->SetJoins("saved_queries JOIN usr USING(user_no) ");
param_to_global('principal_active', '([tf])', 'active'); $browser = new Browser(translate('Calendar Principals')); if (isset($principal_type)) { switch ($principal_type) { case 1: $browser->Title(translate('User Calendar Principals')); break; case 2: $browser->Title(translate('Resource Calendar Principals')); break; case 3: $browser->Title(translate('Group Principals')); break; } } $browser->AddColumn('principal_id', translate('ID'), 'right', '##principal_link##'); $browser->AddColumn('username', translate('Name')); $rowurl = $c->base_url . '/admin.php?action=edit&t=principal&id='; $browser->AddHidden('principal_link', "'<a href=\"{$rowurl}' || principal_id || '\">' || principal_id || '</a>'"); $browser->AddColumn('displayname', translate('Display Name')); $browser->AddColumn('email', translate('EMail')); $browser->AddColumn('member_of', translate('Is Member of'), '', '', 'is_member_of_list(principal_id)'); if (!isset($principal_type) || $principal_type == 3) { $browser->AddColumn('members', translate('Has Members'), '', '', 'has_members_list(principal_id)'); } $browser->SetOrdering('username', 'A'); $browser->SetJoins("dav_principal "); if (isset($principal_active) && $principal_active == 'f') { $browser->SetWhere('NOT user_active'); } else { $browser->SetWhere('user_active');
$browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'"); $browser->SetOrdering('target', 'A'); $browser->SetJoins('access_ticket t LEFT JOIN collection c ON (target_collection_id=collection_id) LEFT JOIN caldav_data d ON (target_resource_id=dav_id)'); $browser->SetWhere('target_collection_id = ' . intval($editor->Value('collection_id'))); $browser->RowFormat('<tr class="r%d">', '</tr>', '#even'); $browser->DoQuery(); $page_elements[] = $browser; /** bind_id | bigint | not null default nextval('dav_id_seq'::regclass) bound_source_id | bigint | access_ticket_id | text | dav_owner_id | bigint | not null parent_container | text | not null dav_name | text | not null dav_displayname | text | */ $browser = new Browser(translate('Bindings to this Collection')); $browser->AddColumn('bind_id', translate('ID'), '', ''); $browser->AddHidden('b.dav_owner_id'); $browser->AddColumn('bound_as', translate('Bound As'), '', '<td style="white-space:nowrap;">%s</td>', 'b.dav_name'); $browser->AddColumn('access_ticket_id', translate('Ticket ID'), '', ''); $browser->AddColumn('privs', translate('Privileges'), '', '', "privileges_list(privileges)"); $delurl = $c->base_url . '/admin.php?action=edit&t=principal&id=##dav_owner_id##&bind_id=##URL:bind_id##&subaction=delete_binding'; $browser->AddColumn('delete', translate('Action'), 'center', '', "'<a class=\"submit\" href=\"{$delurl}\">" . translate('Delete') . "</a>'"); $browser->SetOrdering('target', 'A'); $browser->SetJoins('dav_binding b LEFT JOIN collection c ON (bound_source_id=collection_id) LEFT JOIN access_ticket t ON (ticket_id=access_ticket_id)'); $browser->SetWhere('bound_source_id = ' . intval($editor->Value('collection_id'))); $browser->RowFormat('<tr class="r%d">', '</tr>', '#even'); $browser->DoQuery(); $page_elements[] = $browser; }
<?php param_to_global('external_active', '([tf])', 'active'); $browser = new Browser(translate('External Calendars')); $browser->AddColumn('collection_id', translate('ID'), 'right', '##collection_link##'); $rowurl = $c->base_url . '/admin.php?action=edit&t=collection&id='; $browser->AddHidden('collection_link', "'<a href=\"{$rowurl}' || collection_id || '\">' || collection_id || '</a>'"); $browser->AddColumn('dav_displayname', translate('Display Name')); $browser->AddColumn('refs', translate('References'), 'right', '', '(select count(*) from dav_binding where bound_source_id=collection_id )'); $browser->SetOrdering('dav_displayname', 'A'); $browser->SetJoins("collection "); $browser->SetWhere("parent_container='/.external/'"); $c->page_title = $browser->Title(); if ($c->enable_row_linking) { $browser->RowFormat('<tr onMouseover="LinkHref(this,1);" title="' . htmlspecialchars(translate('Click to display user details')) . '" class="r%d">', '</tr>', '#even'); } else { $browser->RowFormat('<tr class="r%d">', '</tr>', '#even'); } $page_elements[] = $browser; $externalqry = new AwlQuery("SELECT count(*) as count from collection where parent_container='/.external/' and collection_id not in ( select bound_source_id from dav_binding where external_url is not null)"); $externalqry->Exec('external-bind-url'); $external = $externalqry->Fetch(); if ($external->count > 0) { $link = '<a href="' . $c->base_url . '/admin.php?action=edit&t=external&subaction=clean" class="submit">' . translate("Remove dangling external calendars") . '(' . $external->count . ')</a>'; $c->stylesheets[] = 'css/edit.css'; $page_elements[] = $link; }