Register | Login | FAQs | Contact Us
  
 Welcome 
 
 
 Demo 
 
 
 
 Support 
 
 


Integrate with DRM-X - Custom Login Page Integration PHP Guide (Call getLicenseRemote function)

Overview:
DRM-X XML Web service provides the interface you can use DRM-X license service from your website. 

Integration Method: 
1. Synchronize user integration    2. Custom login page integration

Note: Synchronize user integration is synchronize your website users to DRM-X.com your user. You use the default DRM-X login page. We protect the password with strong encryption. It's secure and easy. (Recommend for most users)


Custom login page integration is when user acquiring license, it will pop up your website DRM login window to acquire license. It requires you create a new DRM login page. It requires more code work. (Not Recommend, only for advanced users) 

Here we introduce custom login page integration:


It is very simple just call getLicenseRemote function, and provide several parameter, then DRM-X return license string for you.
The getLicenseRemote function needs the following parameters:


AdminEmail. AdminEmail is your login Email of DRM-X Account.
WebServiceAuthStr. WebServiceAuthStr is the Web Service Authenticate String for DRM-X web service. You can set this value in Profile - Website Integration Preferences of your DRM-X Account.
ProfileID. ProfileID is the License Profile ID. DRM-X provides this parameter. You could request ProfileID using $ProfileID = $HTTP_POST_VARS['ProfileID'];
ClientInfo. ClientInfo is the basic client information of user. DRM-X provides this parameter. You could request ClientInfo using $ClientInfo = $HTTP_POST_VARS['ClientInfo'];
RightsID. RightsID is the ID of rights that you created in your DRM-X Accounts. You can find RightsID value in Rights of DRM-X Accounts.
UserLoginName. UserLoginName is the username or unique UserID in your user database.
UserFullName. UserFullName is the Full Name of User. This parameter is option. You can leave this UserFullName parameter to blank, or just set it value to N/A.
GroupID. GroupID is the ID of your Group that you created in your DRM-X account. You can find GroupID value in Users Group of DRM-X Account.
Message.  Message is the license information, like license rights information returned from DRM-X web service.
IP.  IP is the IP address of your user which acquire license. You can provide this Parameter.

After you call getLicenseRemote function, it will return License Value to you.

STEP BY STEP INSTRUCTIONS

Step 1: The web service URL is :
http://www.drm-x.com/haihaisoftlicenseservice.asmx

Step 2: Then you can create a login page for drm called getlicense.php.

Here is the sample code:
    <?php
session_start();
 require_once('./samples/nusoap.php');

 $wsdl="http://www.drm-x.com/haihaisoftlicenseservice.asmx?wsdl";
 $client=new soapclient($wsdl, 'wsdl');
 $client->soap_defencoding = 'UTF-8';
 $client->decode_utf8 = false;
 $param = array(
    'AdminEmail' =>  'support@haihaisoft.com',
    'WebServiceAuthStr' => 'samplePassword',
        'ProfileID' => '420',
    'ClientInfo' =>'jkSdtmW0upjA7kkfaRvPDxb-T5xpkcXNJgIcK2wPbws=',
        'RightsID' => '179',
        'UserLoginName' => 'User',
        'UserFullName' => 'User',
        'GroupID'=>'106',
        'Message' => '',
        'IP' => '192.168.1.253'
               );
    $result = $client->call('getLicenseRemote', array('parameters' => $param), '', '', true, true);
 
    $license= $result['getLicenseRemoteResult'];
    print_r('<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8">' . $license . '"</head><body>You got the license. <br> <br>Rights information:' . $result['Message']  . '</body></html> ');
 
?>

       
Step 3: Run getlicense.php page. Because you need the ProfileID and ClientInfo parameter from DRM-X, you need to open your encrypted media files to run getlicense.php. Make sure you set the License URL getlicense.php in the Profile - Website Integration Preferences of your DRM-X account. If it returns Message and LicenseValue, then we go to step 4. If it fails, please check all the parameters, and try again.

Step 4: Store license for End user, and display Message.

Let us comment 'Response.Write(Message & LicenseValue), and set Message and LicenseValue in Session.

  ' set Message and LicenseValue in Session, and redirect to LicStore.aspx to deliver license to End User.
        $_SESSION['Message'] = $result['Message'];
        $_SESSION['LicenseValue'] = $license;
        header("Location: LicStore.php");

Create a new page LicStore.php to deliver license to End User. The page name must contains LicStore. If you choose ASP.net or JSP, the page name should be LicStore.aspx or LicStore.jsp.


In the LicStore.php page enter:
<html>
 <head>
 <?php
  session_start();
 print_r($_SESSION['LicenseValue']);
?>
 </head>
 <body>
<?php
 print_r($_SESSION['Message']);
?>
 </body>
</html>

Step 5: Run getlicense.php page. Because you need the ProfileID and ClientInfo parameter from DRM-X, you need to open your encrypted media files to run getlicense.php. Make sure you set the License URL getlicense.php in the Profile - Website Integration Preferences of your DRM-X account.
If the Play button in Haihaisoft Universal Player works, it means all use DRM-X service successfully. Please make sure all the parameters you have provided are correct, and matched the settings in your DRM-X account.

If you have any questions about this article, please feel free to contact us.



Was this information helpful?

You may also be interested in...
Integrate with DRM-X - Custom Login Page Integration ASP.net VB Guide (Call getLicenseRemote function)
Step 6: Protect PDF Documents
Step 4: Create Rights and License Profile
Step 5: Protect Audio/Video Files
DRM-X Getting Started Wizard(All)


For more help, or submit your questions. Please visit Haihaisoft Community
 Search Help Center
 
 
 Troubleshooting Tools
  Integrate with your system
 Top 25 Articles

  • Integrate with DRM-X - Custom Login Page Integration ASP.net VB Guide (Call getLicenseRemote function)


  • DRM-X Getting Started Wizard(All)


  • How does DRM-X protect digital content?


  • Step 6: Protect PDF Documents


  • Who is DRM-X for?



  • See all 25...
     Look Up Terminology
      Glossary

    Need help? Talk with an expert now or get help from Online Help Center

    DRM-X Home - About Us - Fees - Affiliate Program - End User Account - Contact Us - Privacy Statement - DRM-X China - Media-DRM.com - Advanced Services - Advanced Solutions

       © Copyright 2004-2008 Haihaisoft Corporation