forked from metaregistrar/php-epp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangepassword.php
51 lines (43 loc) · 1.22 KB
/
changepassword.php
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
<?php
// Base EPP objects
include_once('Protocols/EPP/eppConnection.php');
include_once('Protocols/EPP/eppRequests/eppIncludes.php');
include_once('Protocols/EPP/eppResponses/eppIncludes.php');
include_once('Protocols/EPP/eppData/eppIncludes.php');
// Connection object to Metaregistrar EPP server - this contains your userid and passwords!
include_once('Registries/Metaregistrar/metaregEppConnection.php');
include_once('Registries/IIS/iisEppConnection.php');
include_once('Registries/SIDN/sidnEppConnection.php');
// Base EPP commands: hello, login and logout
include_once('base.php');
/*
* This script checks for the availability of domain names
*
* You can specify multiple domain names to be checked
*/
if ($argc <= 1)
{
echo "Usage: changepassword <password>\n";
echo "Please enter new password you want to use\n\n";
die();
}
$newpassword = $argv[1];
echo "Changing password\n";
try
{
$conn = new sidnEppConnection();
$conn->setNewPassword($newpassword);
// Connect to the EPP server
if ($conn->connect())
{
if (login($conn))
{
echo "Password was changed\n";
logout($conn);
}
}
}
catch (eppException $e)
{
echo "ERROR: ".$e->getMessage()."\n\n";
}