summaryrefslogtreecommitdiff
path: root/includes/inc_session.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-27 03:26:17 +0100
committerTheTroll <trolldev@gmail.com>2010-02-27 03:26:17 +0100
commit05a58ef6e05078fde0e90f74bf2a609dbc543fd5 (patch)
tree621691bedfd73d2f0642c39a4f9c2d00934c3584 /includes/inc_session.php
parent32b78254c76ebd9a07ad19edf25f1f0846a33bb8 (diff)
downloadistreamdev-05a58ef6e05078fde0e90f74bf2a609dbc543fd5.tar.gz
istreamdev-05a58ef6e05078fde0e90f74bf2a609dbc543fd5.tar.bz2
Sessions are now working yeah!
Diffstat (limited to 'includes/inc_session.php')
-rwxr-xr-xincludes/inc_session.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/inc_session.php b/includes/inc_session.php
index 5c06c0c..95d01cb 100755
--- a/includes/inc_session.php
+++ b/includes/inc_session.php
@@ -4,8 +4,14 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
{
global $httppath, $ffmpegpath, $segmenterpath;
- // TODO: Get a session
- $session = session0;
+ // Get a free session
+ $i=0;
+ for ($i=0; $i<1000; $i++)
+ {
+ $session = "session" .$i;
+ if (!file_exists('ram/' .$session))
+ break;
+ }
// Create session
exec('mkdir ram/' .$session);
@@ -31,6 +37,12 @@ function sessioncreate($type, $name, $title, $desc, $qname, $qparams, $category,
// Write streaminfo
writeinfostream($session, $type, $name, $title, $desc, $qname, $category, $url, $mediapath, $subdir);
+ // Create logo
+ if ($type == 3)
+ generatelogo($type, $url, 'ram/' .$session .'/logo.png');
+ else
+ generatelogo($type, $name, 'ram/' .$session .'/logo.png');
+
// Copy status waiter
exec('cp streamstatus.php ram/' .$session);