} ?> </select> <input type='submit' name='Ajouter' value='Supprimer cette catégorie' /> </fieldset> </form> <h2>Supprimer un document</h2> <form action='index.php' method='POST'> <fieldset> <input type='hidden' name='action' value='untrain'/> Document à supprimer : <select name='docid'> <?php $con = new Connection($login, $pass, $server, $db); $rs = $con->select("SELECT * FROM nb_references"); while (!$rs->EOF()) { echo "<option value='" . $rs->f('id') . "'>" . $rs->f('id') . " - " . $rs->f('category_id') . "</option>\n"; $rs->moveNext(); } ?> </select> <input type='submit' name='Ajouter' value='Supprimer ce document' /> </fieldset> </form> <pre> This file is part of PHP Naive Bayesian Filter. The Initial Developer of the Original Code is Loic d'Anterroches [loic xhtml.net].
/** * Returns this data source wrapped in Fluent object. * @return Fluent */ public function toFluent() { return $this->connection->select('*')->from('(%SQL) t', $this->__toString()); }
/** * Return the groups the given user is a member of * * @param User $user * * @return array */ public function getMemberships(User $user) { $userQuery = $this->ds->select()->from($this->userClass)->where($this->userNameAttribute, $user->getUsername())->setBase($this->userBaseDn)->setUsePagedResults(false); if ($this->userFilter) { $userQuery->where(new Expression($this->userFilter)); } if (($userDn = $userQuery->fetchDn()) === null) { return array(); } $groupQuery = $this->ds->select()->from($this->groupClass, array($this->groupNameAttribute))->where($this->groupMemberAttribute, $userDn)->setBase($this->groupBaseDn); if ($this->groupFilter) { $groupQuery->where(new Expression($this->groupFilter)); } $groups = array(); foreach ($groupQuery as $row) { $groups[] = $row->{$this->groupNameAttribute}; } return $groups; }
<div class="content_section_data"> <form name="frmspamdocremove" method='POST'> <table align="left" class="comm_tbl "> <tr> <td align="left"> <input type='hidden' name='action' value='untrain' /> <?php echo TEXT_EDIT_SPAM_DOCUMENT_REMOVE_TEXT2; ?> : <select name='docid' class="comm_input input_width1a"> <?php $con = new Connection($login, $pass, $server, $db); $rs = $con->select("SELECT * FROM sptbl_spam_references"); while (!$rs->EOF()) { echo "<option value='" . $rs->f('id') . "'>" . $rs->f('id') . " - " . $rs->f('category_id') . "</option>\n"; $rs->moveNext(); } ?> </select> </td><td align="left"> <input type='submit' name='Submit' value='<?php echo TEXT_EDIT_SPAM_DOCUMENT_REMOVE; ?> ' class="comm_btn" /> </td> </tr> </table>
/** * Return the groups the given user is a member of * * @param User $user * * @return array */ public function getMemberships(User $user) { if ($this->groupClass === 'posixGroup') { // Posix group only uses simple user name $userDn = $user->getUsername(); } else { // LDAP groups use the complete DN if (($userDn = $user->getAdditional('ldap_dn')) === null) { $userQuery = $this->ds->select()->from($this->userClass)->where($this->userNameAttribute, $user->getUsername())->setBase($this->userBaseDn)->setUsePagedResults(false); if ($this->userFilter) { $userQuery->where(new Expression($this->userFilter)); } if (($userDn = $userQuery->fetchDn()) === null) { return array(); } } } $groupQuery = $this->ds->select()->from($this->groupClass, array($this->groupNameAttribute))->where($this->groupMemberAttribute, $userDn)->setBase($this->groupBaseDn); if ($this->groupFilter) { $groupQuery->where(new Expression($this->groupFilter)); } Logger::debug('Fetching groups for user %s using filter %s.', $user->getUsername(), $groupQuery->__toString()); $groups = array(); foreach ($groupQuery as $row) { $groups[] = $row->{$this->groupNameAttribute}; } Logger::debug('Fetched %d groups: %s.', count($groups), join(', ', $groups)); return $groups; }