Am 14.07.2011 14:55, schrieb Solvik BLUM:
> Hi,
>
> I used something like that:
>
> harbor_password = interactive.string("harbor_password", "toto")
>
> def auth(user, password)
>     if user == "source" and password == harbor_password() then
>       true
>     else
>       false
>     end
> end
>
> live = input.harbor(port=9000, auth=auth, mountpoint)
>
> Then you connect in telnet and do "var.set harbor_password = "titi""
>
> Hope it helped :)
>
> Solvik
>
> Le 14 juil. 2011 à 13:24, Alexander a écrit :
>
>> Hello,
>> i have one question about harbour input organization.
>> As i know, harbour supports only 1 live stream, e.g. only 1 man can connect 
>> one time.
>> For example, i have 4 DJs.
>>
>> So, to make live streaming DJ should register his live air time. DJs can not 
>> register 2 live airs in one time.
>> After this, we can know who is streaming and when & display this on the 
>> website.
>>
>> Then, each DJ should have his own password for harbour. Can we put create 
>> $password variable in .liq config & change it using telnet?
>>
>> For example, i can have cron script, that will check every minute for new 
>> registered live streams. If one is coming - aha! we execute telnet command, 
>> that changes password for harbour - so only his owner can connect & make 
>> live stream.
>>
>> -- 
>> Kind regards,
>> Alexander.
>>
hey,
we auth our djs by a known unique token as a password, which comes from
mysql.
in short words:
mysqltable:
dj_name    password
dj1            xxxxxx
dj2            yyyyyy
dj3            ...

so in your auth function you can use a reply from php,shellscript, or
any other, here shellscript:
def authfunction =
    returnedvalue = get_process_lines("/path/liqauth.sh #{password}")
    dj = list.hd(returnedvalue)
    #check the output, you could output "error/unknown/whatever" if
password is wrong, or en error occured in your shellscript...
    if dj == "error/unknown/whatever" then
        false
    else
        #if you found a dj for the token you could set it on webpage,
again via get_process_lines...
        true
    end
end

i will post a more detailed example, soon on our snippet section...

greez,
mcc


------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to