mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 17:20:13 +01:00
fixed the group email autocomplete stuff
This commit is contained in:
parent
760a76121a
commit
9e88184509
@ -168,16 +168,38 @@ class ModelGroupGroup extends Model {
|
||||
}
|
||||
}
|
||||
|
||||
sort($emails);
|
||||
|
||||
if(strlen($s) == 1 && ENABLE_LDAP_AUTH == 1) {
|
||||
$emails = array_slice($emails, $page * $page_len, $page_len);
|
||||
}
|
||||
|
||||
return $emails;
|
||||
}
|
||||
|
||||
|
||||
public function count_emails($s = '') {
|
||||
if(strlen($s) < 1) { return 0; }
|
||||
$count = 0;
|
||||
|
||||
if(strlen($s) < 1) { return $count; }
|
||||
|
||||
if(ENABLE_LDAP_AUTH == 1) {
|
||||
$ldap = new LDAP(LDAP_HOST, LDAP_HELPER_DN, LDAP_HELPER_PASSWORD);
|
||||
if($ldap->is_bind_ok()) {
|
||||
|
||||
$query = $ldap->query(LDAP_BASE_DN, "(&(objectClass=" . LDAP_ACCOUNT_OBJECTCLASS . ")(" . LDAP_MAIL_ATTR . "=" . $s . "*))", array());
|
||||
|
||||
if(isset($query->rows)) {
|
||||
$count = $query->num_rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->db->query("SELECT COUNT(*) AS num FROM `" . TABLE_EMAIL . "` WHERE email LIKE ?", array($s . "%") );
|
||||
|
||||
return $query->row['num'];
|
||||
$count += $query->row['num'];
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
<label class="control-label" for="throwaway"><?php print $text_select_letter; ?>:</label>
|
||||
<div class="controls">
|
||||
<?php foreach(Registry::get('letters') as $letter) { ?>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400');" ><?php print $letter; ?></a>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400,scroll=yes');" ><?php print $letter; ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -44,7 +44,7 @@
|
||||
<label class="control-label" for="throwaway"><?php print $text_select_letter; ?>:</label>
|
||||
<div class="controls">
|
||||
<?php foreach(Registry::get('letters') as $letter) { ?>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400');" ><?php print $letter; ?></a>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400,scroll=yes');" ><?php print $letter; ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<div class="domaincell"><textarea style="height:280px;" name="email" id="email" class="span5"><?php if(isset($post['email'])){ print $post['email']; } ?></textarea></div>
|
||||
<div class="domaincell">
|
||||
<?php foreach(Registry::get('letters') as $letter) { ?>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400');" ><?php print $letter; ?></a>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400,scroll=yes');" ><?php print $letter; ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<div class="domaincell"><textarea style="height:280px;" name="email" id="email" class="span5"><?php if(isset($email)){ print $email; } ?></textarea></div>
|
||||
<div class="domaincell">
|
||||
<?php foreach(Registry::get('letters') as $letter) { ?>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400');" ><?php print $letter; ?></a>
|
||||
<a href="#" onclick="window.open('<?php print SITE_URL; ?>index.php?route=group/email&term=<?php print $letter; ?>', 'aaa', 'width=300,height=400,scroll=yes');" ><?php print $letter; ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user