Skip to content

Commit

Permalink
added option for external users only
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed Jul 20, 2009
1 parent 257991b commit 14799ca
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions interface/usergroup/addrbook_list.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2006-2008 Rod Roark <[email protected]>
// Copyright (C) 2006-2009 Rod Roark <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
Expand All @@ -14,11 +14,13 @@
$form_fname = trim($_POST['form_fname']);
$form_lname = trim($_POST['form_lname']);
$form_specialty = trim($_POST['form_specialty']);
$form_external = $_POST['form_external'] ? 1 : 0;

$query = "SELECT * FROM users WHERE active = 1 AND ( authorized = 1 OR username = '' ) ";
if ($form_lname) $query .= "AND lname LIKE '$form_lname%' ";
if ($form_fname) $query .= "AND fname LIKE '$form_fname%' ";
if ($form_specialty) $query .= "AND specialty LIKE '%$form_specialty%' ";
if ($form_external) $query .= "AND username = '' ";
$query .= "ORDER BY lname, fname, mname LIMIT 500";
$res = sqlStatement($query);
?>
Expand Down Expand Up @@ -63,15 +65,18 @@ function doedclick(userid) {
<table>
<tr class='search'> <!-- bgcolor='#ddddff' -->
<td>
<?php xl('First Name:','e')?>
<?php xl('First Name','e')?>:
<input type='text' name='form_fname' size='10' value='<?php echo $form_fname; ?>'
class='inputtext' title='<?php xl("All or part of the first name","e") ?>' />&nbsp;
<?php xl('Last Name:','e')?>
<?php xl('Last Name','e')?>:
<input type='text' name='form_lname' size='10' value='<?php echo $form_lname; ?>'
class='inputtext' title='<?php xl("All or part of the last name","e") ?>' />&nbsp;
<?php xl('Specialty:','e')?>
<?php xl('Specialty','e')?>:
<input type='text' name='form_specialty' size='10' value='<?php echo $form_specialty; ?>'
class='inputtext' title='<?php xl("Any part of the desired specialty","e") ?>' />&nbsp;&nbsp;
class='inputtext' title='<?php xl("Any part of the desired specialty","e") ?>' />&nbsp;
<input type='checkbox' name='form_external' value='1'<?php if ($form_external) echo ' checked'; ?>
title='<?php xl("Omit internal users?","e") ?>' />
<?php xl('External Only','e')?>&nbsp;&nbsp;
<input type='submit' class='button' name='form_search' value='<?php xl("Search","e")?>' />
</td>
<td align='right'>
Expand Down

0 comments on commit 14799ca

Please sign in to comment.