C O N O S C E N Z A
web data management
Il nostro è un team che si occupa ormai da piu' di un decennio della risoluzione delle problematiche informatiche, in particolare ci piace poter offrire la nostra competenza in ambito telematico, dalla progettazione su misura della vostra infrastruttura web, alla realizzazione del vostro software e dei vostri portali.
Web

autologon on openmeetings

28/09/2008

    Example for openmeetings auto login   by php    

 For required SOAP params serializations you must download and include in you script only  the nusoap.php class by moodle open meetings module from:

http://openmeetings.googlecode.com/files/openmeetings_moodle_plugin_v02.zip ù

Remember to replace admin username e pass, and simple user data too  

    
 <?

$username='nadia';
$firstname='nadia';
 $lastname='nadia';
 
$email='';

require_once('nusoap.php');
$client_userService = new nusoap_client("http://yourserver:yuorport/openmeetings/services/UserService?wsdl", "wsdl");
//$client_userService->setUseCurl(true);
    $err = $client_userService->getError();
        if ($err) {
            echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
            echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
            exit();
        }


        $resultSesssion = $client_userService->call('getSession');
        if ($client_userService->fault) {
            echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
        } else {
            $err = $client_userService->getError();
            if ($err) {
                echo '<h2>Error2</h2><pre>' . $err . '</pre>';
            } else {
               
                //echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>';
                $client_userService->session_id = $resultSesssion["return"]["session_id"];
                //echo '<h2>Result</h2><pre>'; printf(); echo '</pre>';
                $params = array(
                    'SID' => $client_userService->session_id,
                    'username' => 'admin',
                    'userpass' => admin'
                );
               
                //$params = array();
               
                $result = $client_userService->call('loginUser',$params);
                //echo '<h2>Params</h2><pre>'; print_r($params); echo '</pre>';
                if ($client_userService->fault) {
                    echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
                } else {
                    $err = $client_userService->getError();
                    if ($err) {
                        echo '<h2>Error</h2><pre>' . $err . '</pre>';
                    } else {
                         
                    }
                }
            }
        }

     
 
        $params = array(
            'SID' => $client_userService->session_id,
            'username' => $username,
            'firstname' => $firstname,
            'lastname' => $lastname,
            'profilePictureUrl' => '',
            'email' => 'nadia@nadia.it'
        );
        $resultO = $client_userService->call('setUserObject',$params);
        if ($client_userService->fault) {
            echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>';
        } else {
            $err = $client_userService->getError();
            if ($err) {
                echo '<h2>Error</h2><pre>' . $err . '</pre>';
            } else {
                print_r($resultO);
                 
         ?>
<iframe name="openmeetings" id="openmeetings" title="Openmeetings" frameborder="1" scrolling="auto" src="http://yourserver:yuorport/openmeetings/main.lzx.lzr=swf8.swf?roomid=1&sid=<?php echo $client_userService->session_id;?>" height="700" width="90%" align="center" style="border:thin white solid; align:center;" allowautotransparency="true"></iframe>     
    <?         
            }
        /*
             $param = array ('SID' => $client_userService->session_id,
 'errorid' => $resultO['result'],
 'language_id' => 4);
                          
$getErrorByCode = $client_userService2->call('getErrorByCode',$params);
echo "<hr>";
 var_dump($getErrorByCode);*/
           
        }
         
?>