}
}
if (sizeof($_GET)) {
    AdminServers::reload();
}
if (sizeof($_POST)) {
    AdminServers::reload();
}
$output = new Output();
$template = Template::fromFile('view/admin_servers.html');
$template->assign('localServerName', $localServer->name());
if ($localServer->isEmpty() || AdminServers::$editName) {
    $template->addSubtemplate('defineName');
} else {
    $sub = $template->addSubtemplate('listServers');
    if ($localServer->rememberNewServers()) {
        $sub->addSubtemplate('rememberingServers');
    } else {
        $sub->addSubtemplate('notRememberingServers');
    }
    if ($localServer->acceptSuggestedServers()) {
        $sub->addSubtemplate('acceptingSuggestedServers');
    } else {
        $sub->addSubtemplate('notAcceptingSuggestedServers');
    }
    $activeServers = ExternalServerPool::whiteServerPool();
    $sub->assign('numOfActive', $activeServers->size());
    foreach ($activeServers->toArray() as $server) {
        $a = $sub->addSubtemplate('activeListEntry');
        $a->assign('url', $server->getUrl());
        $a->assign('name', $server->getName());
Example #2
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once 'books/SearchKey.php';
require_once 'net/Message.php';
require_once 'net/LocalServer.php';
require_once 'books/LocalSearchExportBookList.php';
$searchKey = new SearchKey();
if (!$searchKey->isGiven()) {
    exit;
}
$localServer = new LocalServer();
if (isset($_GET['from']) && $localServer->rememberNewServers()) {
    require_once 'net/ExternalServer.php';
    $requestingServer = ExternalServer::newFromUrlString($_GET['from']);
    if ($requestingServer) {
        require_once 'mysql_conn.php';
        $query = 'insert into servers (url, next_try) values (' . '"' . $requestingServer->getUrl() . '", ' . '"9999-12-31");';
        mysql_query($query);
    }
}
$bookList = new LocalSearchExportBookList($searchKey);
$message = new Message($localServer->name());
if ($bookList->size() > 0) {
    $message->setBooks($bookList->getList());
} else {
    require_once 'net/ExternalServerPool.php';
    $serverPool = ExternalServerPool::activeServerPool();