Précédent   Forum des professionnels en informatique > Logiciels > Autres Logiciels > Vidéo
Vidéo Forum d'entraide sur les logiciels pour la gestion Vidéo, TV, logiciels Webcams, ...
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 28/03/2008, 23h48   #1
Invité de passage
 
Inscription : mars 2008
Messages : 2
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 2
Points : 0
Points : 0
Par défaut Icecast Auth URL pour Vbulletin

Bonjours tous le monde.

Alors voila j'ai installer icecast sur un serveur windows 2003
et j'aimerais utiliser icecast comme logiciel afin de diffuser
mon flux video et utiliser l'authentification url d'icecast
mais je ne c'est pas comment faire.
J'ai correctement configure le fichier de configuration (icecast.xml)

voici mon mountpoint:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    <mount>
        <mount-name>/live.nsv</mount-name> 
        <stream-name>Stream names</stream-name> 
        <stream-description>Description</stream-description> 
        <stream-url>http://www.domaine.net</stream-url> 
        <genre>Classic</genre> 
        <bitrate>60</bitrate> 
     <authentication type="url">
        <option name="mount_add" value="http://www.domaine.net/icecast/action.php" /> 
        <option name="mount_remove" value="http://www.domaine.net/icecast/action.php" /> 
        <option name="listener_add" value="http://www.domaine.net/icecast/action.php" /> 
        <option name="listener_remove" value="http://www.domaine.net/icecast/action.php" /> 
    </authentication>
    </mount>
je c'est que le fichier action.php autorise ou refuse les connexion

Action.php
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<? 
include "config.php";
include "db.php";
?>
<?
	$db = new DB($mysql_host, $mysql_user, $mysql_password, $mysql_db);
?>
<?

$mount = "";
$username = "";
$password = "";
$action = "";
$server = "";
$port = "";
$duration = "";

$listener_add = "listener_add";
$listener_remove = "listener_remove";
$mount_add = "mount_add";
$mount_remove = "mount_remove";

function insertAudit($db, $user, $server, $mount, $action) {
	global $table_prefix;
	$query = "insert into ".$table_prefix."audit (datestamp, username, server, mountpoint, action) values (NOW(), '".mysql_real_escape_string($user)."', '".mysql_real_escape_string($server)."', '".mysql_real_escape_string($mount)."', '".mysql_real_escape_string($action)."')";
	mysql_query($query, $db->link);
}

if (isset($_REQUEST["server"])) {
	$server=$_REQUEST["server"];
}
if (isset($_REQUEST["port"])) {
	$port=$_REQUEST["port"];
}

$servertext = "";
if (($server != "") && ($port != "")) {
	$servertext = "$server:$port";
}
if (isset($_REQUEST["duration"])) {
	$duration=$_REQUEST["duration"];
}
if (isset($_REQUEST["action"])) {
	$action=$_REQUEST["action"];
}
else {
	header('icecast-auth-user: 0');
	header('icecast-auth-message: action not supplied');
	exit;
}

if (isset($_REQUEST["mount"])) {
	$mount=$_REQUEST["mount"];
}
else {
	header('Response: 0');
	header('ResponseMessage: mount not supplied');
	exit;
}

if (isset($_REQUEST["user"])) {
	$username=$_REQUEST["user"];
}
else {
	if (($action == $listener_add) || ($action == $listener_remove)) {
		header('icecast-auth-user: 0');
		header('icecast-auth-message: username not supplied');
		exit;
	}
}

if (isset($_REQUEST["pass"])) {
	$password=$_REQUEST["pass"];
}
else {
	if (($action == $listener_add) || ($action == $listener_remove)) {
		header('icecast-auth-user: 0');
		header('icecast-auth-message: password not supplied');
		exit;
	}
}


if ($action == $listener_add) {
	$query = "select password, timeleft from ".$table_prefix."users where mountpoint = '".mysql_real_escape_string($mount)."' and username = '".mysql_real_escape_string($username)."'";
	$result = mysql_query($query, $db->link);
	$row = mysql_fetch_assoc($result);
	if ($row) {
		$pass = $row['password'];
		$time = (int)$row['timeleft'];
		if ($pass == $password) {
			if ($time != -1) {
				if ($time == 0) {
					header('icecast-auth-user: 0');
					header('icecast-auth-message: all time expired');
					//insertAudit($db, $username, $servertext, $mount, "Failed Auth - time expired");
					exit;
				}
				else {
					header('icecast-auth-user: 1');
					header('icecast-auth-message: OK');
					header("icecast-auth-timelimit: $time");
					insertAudit($db, $username, $servertext, $mount, "Listen Start - timelimit $time");
					exit;
				}
			}
			else {
				header('icecast-auth-user: 1');
				header('icecast-auth-message: OK');
				insertAudit($db, $username, $servertext, $mount, "Listen Start");
				exit;
			}
		}
		else {
			header('icecast-auth-user: 0');
			header('icecast-auth-message: invalid password');
			//insertAudit($db, $username, $servertext, $mount, "Failed Auth - invalid password");
			exit;
		}
	}
	else {
		$query = "select password, timeleft from ".$table_prefix."users where mountpoint = 'ALL' and username = '".mysql_real_escape_string($username)."'";
		$result = mysql_query($query, $db->link);
		$row = mysql_fetch_assoc($result);
		if ($row) {
			$pass = $row['password'];
			$time = 0;
			$time = $row['timeleft'];
			if ($pass == $password) {
				if ($time != -1) {
					if ($time == 0) {
						header('icecast-auth-user: 0');
						header('icecast-auth-message: all time expired');
						//insertAudit($db, $username, $servertext, $mount, "Failed Auth - time expired");
						exit;
					}
					else {
						header('icecast-auth-user: 1');
						header('icecast-auth-message: OK');
						header("icecast-auth-timelimit: $time");
						insertAudit($db, $username, $servertext, $mount, "Listen Start - timelimit $time");
						exit;
					}
				}
				else {
					header('icecast-auth-user: 1');
					header('icecast-auth-message: OK');
					insertAudit($db, $username, $servertext, $mount, "Listen Start");
					exit;
				}
			}
			else {
				header('icecast-auth-user: 0');
				header('icecast-auth-message: invalid password');
				//insertAudit($db, $username, $servertext, $mount, "Failed Auth - invalid password");
				exit;
			}
		}
		else {
			header('icecast-auth-user: 0');
			header('icecast-auth-message: invalid user');
			//insertAudit($db, $username, $servertext, $mount, "Failed Auth - invalid user");
			exit;
		}
	}
}
if ($action == $listener_remove) {

	if ($duration == "") {
		header('icecast-auth-user: 0');
		header('icecast-auth-message: missing duration');
		insertAudit($db, $username, $servertext, $mount, "Listener Remove");
		exit;
	}
	$timespentlistening = 0;
	$timespentlistening = (int)$duration;

	$query = "select timeleft from ".$table_prefix."users where mountpoint = '".mysql_real_escape_string($mount)."' and username = '".mysql_real_escape_string($username)."'";
	$result = mysql_query($query, $db->link);
	$row = mysql_fetch_assoc($result);
	if ($row) {
		$time = 0;
		$time = (int)$row['timeleft'];
		$timeremaining = $time - $timespentlistening;
		if ($timeremaining < 0) {
			$timeremaining = 0;
		}
		if ($time == -1) {
			$timeremaining = -1;
		}
		$query2 = "update ".$table_prefix."users set timeleft = $timeremaining where mountpoint = '".mysql_real_escape_string($mount)."' and username = '".mysql_real_escape_string($username)."'";
		$result2 = mysql_query($query2, $db->link);
		insertAudit($db, $username, $servertext, $mount, "Listener Remove ($duration secs)");
	}
	else {
		$query = "select timeleft from ".$table_prefix."users where mountpoint = 'ALL' and username = '".mysql_real_escape_string($username)."'";
		$result = mysql_query($query, $db->link);
		$row = mysql_fetch_assoc($result);
		if ($row) {
			$time = 0;
			$time = (int)$row['timeleft'];
			$timeremaining = $time - $timespentlistening;
			if ($timeremaining < 0) {
				$timeremaining = 0;
			}
			if ($time == -1) {
				$timeremaining = -1;
			}
			$query2 = "update ".$table_prefix."users set timeleft = $timeremaining where mountpoint = 'ALL' and username = '".mysql_real_escape_string($username)."'";
			$result2 = mysql_query($query2, $db->link);
			insertAudit($db, $username, $servertext, $mount, "Listener Remove ($duration secs)");
		}
		else {
			header('icecast-auth-user: 0');
			header('icecast-auth-message: invalid user');
			//insertAudit($db, $username, $servertext, $mount, "Failed Listener Remove - invalid user");
			exit;
		}
	}
}
if ($action == $mount_add) {
	insertAudit($db, "", $servertext, $mount, "Mount connect");
	header('icecast-auth-message: OK');
}
if ($action == $mount_remove) {
	insertAudit($db, "", $servertext, $mount, "Mount disconnect");
	header('icecast-auth-message: OK');
}
?>
Alors ma questiion:

Comment faire pour integré l'authentification d'icecast a vbulletin 3.6.8

Merci pour vos reponse
takerman est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/03/2008, 18h46   #2
Invité de passage
 
Inscription : mars 2008
Messages : 2
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 2
Points : 0
Points : 0
personne a la solution
takerman est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h10.


 
 
 
 
Partenaires

Hébergement Web