summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config8
-rw-r--r--module/remote/RequestHandler.py2
-rw-r--r--module/web/WebServer.py13
-rw-r--r--module/web/templates/default.tpl71
-rwxr-xr-xpyLoadCli.py2
5 files changed, 43 insertions, 53 deletions
diff --git a/config b/config
index 7ec9ab547..4752a459b 100644
--- a/config
+++ b/config
@@ -1,6 +1,12 @@
[remote]
port = 7272
-remotepassword = pwhere
+password = pwhere
+
+[webinterface]
+activated = True
+port = 8080
+username = User
+password = webpw
[log]
file_log = True
diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py
index 415a8bba7..a879d2297 100644
--- a/module/remote/RequestHandler.py
+++ b/module/remote/RequestHandler.py
@@ -21,7 +21,7 @@ from RequestObject import RequestObject
class RequestHandler:
def __init__(self, core):
self.core = core
- key = hashlib.sha256(core.config['remotepassword'])
+ key = hashlib.sha256(core.config['remote']['password'])
self.bf = Blowfish.new(key.hexdigest(), Blowfish.MODE_ECB)
def proceed(self, data):
diff --git a/module/web/WebServer.py b/module/web/WebServer.py
index d2bf9b3a8..ad0d03512 100644
--- a/module/web/WebServer.py
+++ b/module/web/WebServer.py
@@ -39,9 +39,16 @@ core = None
PATH = "./module/web/"
+@route('/', method= 'POST')
+def home():
+ #print request.GET
+ print request.POST
+
+ return template('default', page='home', links=core.get_downloads())
+
@route('/')
-def hello_world():
- return template('default', string=str(core.get_downloads()))
+def login():
+ return template('default', page='login')
@route('/favicon.ico')
def favicon():
@@ -67,4 +74,4 @@ class WebServer(threading.Thread):
bottle.TEMPLATE_PATH.append('./module/web/templates/%s.tpl')
def run(self):
- run(host='localhost', port=8080) \ No newline at end of file
+ run(host='localhost', port=int(self.core.config['webinterface']['port'])) \ No newline at end of file
diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl
index a375df20d..70671028e 100644
--- a/module/web/templates/default.tpl
+++ b/module/web/templates/default.tpl
@@ -8,19 +8,11 @@
<div id="head-search-and-login">
- <form action="" accept-charset="utf-8">
- <label for="head-search"><img src="static/default/head-search-noshadow.png" alt="Search" style="vertical-align:middle; margin:2px" /></label>
- <input type="hidden" name="do" value="search" />
- <input id="head-search" type="text" style="width:140px;" value="search" accesskey="f" name="id" title="" />
- </form>
-
-
- <img src="static/default/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">RaNaN (ranan) </span>
+ <img src="static/default/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">User</span>
<ul id="user-actions">
<li><a href="/start?do=logout&amp;sectok=ff40bdf226c283991652e062d187c43a" class="action logout" rel="nofollow">Logout</a></li>
- <li><a href="/start?do=profile" class="action profile" rel="nofollow">Update Profile</a></li>
<li></li>
<li></li>
</ul>
@@ -31,19 +23,15 @@
<div id="head-menu">
<ul>
- <li class=" selected"><a href="/" title=""><img src="static/default/head-menu-home.png" alt="" /> Home</a></li><li class=""><a href="/news" title=""><img src="static/default/head-menu-news.png" alt="" /> News</a></li><li class=""><a href="/wiki" title=""><img src="static/default/head-menu-wiki.png" alt="" /> Wiki</a></li><li class=""><a href="/download" title=""><img src="static/default/head-menu-download.png" alt="" /> Download</a></li><li class=""><a href="/development" title=""><img src="static/default/head-menu-development.png" alt="" /> Development</a></li><li class="right"><a href="/start?do=index" class="action index" accesskey="x" rel="nofollow"><img src="static/default/head-menu-index.png" alt="" />Index</a></li><li class="right"><a href="/start?do=recent" class="action recent" accesskey="r" rel="nofollow"><img src="static/default/head-menu-recent.png" alt="" />Recent Changes</a></li> </ul>
+ <li class=" selected"><a href="/" title=""><img src="static/default/head-menu-home.png" alt="" /> Home</a></li><li class=""><a href="/news" title=""><img src="static/default/head-menu-news.png" alt="" /> News</a></li><li class=""><a href="/wiki" title=""><img src="static/default/head-menu-wiki.png" alt="" /> Wiki</a></li><li class=""><a href="/download" title=""><img src="static/default/head-menu-download.png" alt="" /> Download</a></li><li class=""><a href="/development" title=""><img src="static/default/head-menu-development.png" alt="" /> Development</a></li><li class="right"><a href="/start?do=index" class="action index" accesskey="x" rel="nofollow"><img src="static/default/head-menu-index.png" alt="" />Logs</a></li> </ul>
</div>
<div style="clear:both;"></div>
</div>
<ul id="page-actions">
- <li><a href="/start?do=edit&amp;rev=" class="action edit" accesskey="e" rel="nofollow">Edit this page</a></li>
- <li><a href="/start?do=revisions" class="action revisions" accesskey="o" rel="nofollow">Old revisions</a></li>
- <li><a href="/start?do=backlink" class="action backlink" rel="nofollow">Backlinks</a></li>
- <li></li>
- <!--<li><a href="/start?do=index" class="action index" accesskey="x" rel="nofollow">Index</a></li>
- <li><a href="/start?do=recent" class="action recent" accesskey="r" rel="nofollow">Recent changes</a></li>-->
+ <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li>
+
</ul>
<div id="body-wrapper" class="dokuwiki">
@@ -51,47 +39,36 @@
<div id="content" lang="en" dir="ltr">
-<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — download manager for 1 click hoster</a></h1>
+<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a></h1>
<div class="level1">
-<p>
+%if page == "login":
-<a href="/screenshots" class="media" title="screenshots"><img src="/_media/:screenshot-reflection-small.png" class="mediaright" align="right" alt="" /></a>
-</p>
+</div>
+<div class="centeralign">
+<form action="" method="post" accept-charset="utf-8" id="login"><div class="no">
+<input type="hidden" name="do" value="login" /><fieldset ><legend>Login</legend>
+<label class="block" for="focus__this"><span>Username</span> <input type="text" id="focus__this" name="u" class="edit" /></label><br />
+<label class="block"><span>Password</span> <input type="password" name="p" class="edit" /></label><br />
+<label class="simple" for="remember__me"><input type="checkbox" id="remember__me" name="r" value="1" /> <span>Remember me</span></label>
+<input type="submit" value="Login" class="button" />
+</fieldset>
+</div></form>
+</div>
+<br>
-<p>
-pyLoad is a free and open source downloader for 1-click-hosting sites like rapidshare.com or uploaded.to.
-</p>
+%else:
+<h2>Downloads:</h2>
-<p>
-Link-Crypt services like lix.in as well as the Link-Container Files RSDF, CCF and DLC are also supported.
-</p>
+% for link in links:
<p>
-pyLoad is currently under heavy development. It aims to be fully automated in as many ways as possible, so you don&#039;t have to sit in front of your computer waiting for a download ticket. It will be good for long-time unattended downloading of files from sharehosters.
+{{str(link)}}
</p>
-</div>
-
-<h2><a name="features" id="features">Features</a></h2>
-<div class="level2">
-<ul>
-<li class="level1"><div class="li"> <strong>written entirely in Python</strong></div>
-</li>
-<li class="level1"><div class="li"> <strong>gets links from Link-Crypt services</strong></div>
-</li>
-<li class="level1"><div class="li"> <strong>can open RSDF, CCF and DLC containers</strong></div>
-</li>
-<li class="level1"><div class="li"> <strong>User interfaces: CLI and wxWidgets (currently in development)</strong></div>
-</li>
-<li class="level1"><div class="li"> <strong>Open Source and Free Software (<acronym title="GNU General Public License">GPL</acronym> v3 or later)</strong></div>
-</li>
-</ul>
-
-</div>
-
- </div>
+%end
+%end
<hr style="clear: both;" />
<div id="foot">© 2008-2009 the pyLoad Team
diff --git a/pyLoadCli.py b/pyLoadCli.py
index 07ac55e5e..d01dc2280 100755
--- a/pyLoadCli.py
+++ b/pyLoadCli.py
@@ -328,7 +328,7 @@ if __name__ == "__main__":
address = "127.0.0.1"
port = config.get("remote", "port")
- password = config.get("remote", "remotepassword")
+ password = config.get("remote", "password")
elif len(sys.argv) != 4:
address = raw_input("Adress:")