summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorAlib <aliboba@free.fr>2010-02-28 16:05:10 +0100
committerAlib <aliboba@free.fr>2010-02-28 16:05:10 +0100
commit52f10a942c7f81e649817890b82d4ff70bc7ab29 (patch)
tree5bd96c71e13e043d30b2b6b8eb16ce9c79c77a75 /includes
parent3bacf5b55fa8fd2135f4811683cb4c20c1d3cb0d (diff)
parent547fd24f4b448e7b56c91c91bfc2630521c50ac6 (diff)
downloadistreamdev-52f10a942c7f81e649817890b82d4ff70bc7ab29.tar.gz
istreamdev-52f10a942c7f81e649817890b82d4ff70bc7ab29.tar.bz2
Merge branch 'master' of projects.vdr-developer.org:istreamdev
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/inc_home.php18
-rwxr-xr-xincludes/inc_session.php27
-rwxr-xr-xincludes/include.php5
3 files changed, 47 insertions, 3 deletions
diff --git a/includes/inc_home.php b/includes/inc_home.php
index c4416ba..f38518c 100755
--- a/includes/inc_home.php
+++ b/includes/inc_home.php
@@ -70,9 +70,21 @@ if ($dir_handle)
}
if (!$sessioncnt)
- print "<li class=\"textbox\"><p>none</p></li>\r\n";
-
-print " </ul>\r\n";
+{
+ print " <li class=\"textbox\"><p>none</p></li>\r\n";
+ print "</ul>\r\n";
+}
+else
+{
+ print "</ul>\r\n";
+ print "<form name=\"killall\" id=\"killall\" method=\"post\" action=\"index.php\">\r\n";
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"stopallstreamings\" />\r\n";
+ print " <ul class=\"pageitem\">\r\n";
+ print " <li class=\"button\">\r\n";
+ print " <input name=\"Submit\" type=\"submit\" value=\"Delete all sessions\" /></li>\r\n";
+ print "</ul>\r\n";
+ print "</form>\r\n";
+}
// VDR menus
if ($vdrenabled)
diff --git a/includes/inc_session.php b/includes/inc_session.php
index 9cc0a26..6c913f9 100755
--- a/includes/inc_session.php
+++ b/includes/inc_session.php
@@ -49,6 +49,33 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
function sessiondelete($session)
{
+ if ($session == 'all')
+ {
+ $dir_handle = @opendir('ram/');
+ if ($dir_handle)
+ {
+ while ($session = readdir($dir_handle))
+ {
+ if($session == "." || $session == ".." || $session == 'lost+found')
+ continue;
+
+ if (!is_dir('ram/' .$session))
+ continue;
+
+ // Get info
+ list($type, $realname, $title, $desc, $mode, $category, $url, $mediapath, $subdir) = readinfostream($session);
+
+ if ($type)
+ sessiondeletesingle($session);
+ }
+ }
+ }
+ else
+ return sessiondeletesingle($session);
+}
+
+function sessiondeletesingle($session)
+{
$ram = "ram/" .$session ."/";
// Get segmenter PID if any
diff --git a/includes/include.php b/includes/include.php
index 05a2ce6..de9cfa4 100755
--- a/includes/include.php
+++ b/includes/include.php
@@ -54,6 +54,11 @@ function selectpage()
case ("stream"):
include('includes/inc_stream.php');
break;
+ case ("stopallstreamings"):
+ sessiondelete('all');
+ $_SESSION['currentcat'] = NULL;
+ include('includes/inc_home.php');
+ break;
case ("listcategory"):
include('includes/inc_cat.php');
break;