0byt3m1n1
Path:
/
data
/
applications
/
aps
/
owl
/
1.0-0
/
standard
/
htdocs
/
admin
/
tools
/
[
Home
]
File: autobrowse.php
<?php /** * admin/tools/autobrowse.php * * Author: Steve Bourgeois <owl@bozzit.com> * * Copyright (c) 2006-2009 Bozz IT Consulting Inc * * Licensed under the GNU GPL. For full terms see the file LICENSE. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * 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, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: autobrowse.php,v 1.1.1.1 2010/01/04 14:36:15 b0zz Exp $ */ $defaults->db_host = "localhost"; $defaults->db_user = "root"; $defaults->db_passwd = "<YOUR PASWORD>"; $defaults->db_name = "owl096"; $ip = "127.0.0.1"; $iNumberPasses = 5; $dblink = mysql_connect($defaults->db_host,$defaults->db_user,$defaults->db_passwd) or die ("could not connect to database"); mysql_select_db($defaults->db_name); $current = time(); $random = "darchive_autobrowse". $current; $sessid = md5($random); // Create a session // $sQuery = "INSERT INTO active_sessions VALUES ('$sessid', '1', '$current', '$ip', '0')"; $rReadResult = mysql_query($sQuery); if (!$rReadResult) { die('Invalid query: ' . mysql_error()); } // Create a session // $sQuery = "UPDATE prefs set lookathd = 'true'"; $rReadResult = mysql_query($sQuery); if (!$rReadResult) { die('Invalid query: ' . mysql_error()); } for ($c = 0; $c < $iNumberPasses; $c++) { $sQuery = "SELECT id FROM folders "; $rReadResult = mysql_query($sQuery); if (!$rReadResult) { die('Invalid query: ' . mysql_error()); } while ($aFolders = mysql_fetch_assoc($rReadResult)) { $sCommand = "lynx -dump \"http://127.0.0.1/owl-1.00a/browse.php?sess=$sessid&parent=" . $aFolders['id'] ."&expand=0&order=name&sortname=&curview=0\" > /dev/null"; exec($sCommand); } } // Create a session // $sQuery = "UPDATE prefs set lookathd = 'false'"; $rReadResult = mysql_query($sQuery); if (!$rReadResult) { die('Invalid query: ' . mysql_error()); } $sQuery = "DELETE FROM active_sessions WHERE sessid = '$sessid'"; $rReadResult = mysql_query($sQuery); if (!$rReadResult) { die('Invalid query: ' . mysql_error()); } ?>