} else { if (isset($password) && empty($password)) { $registration_failed = TRUE; $registration_message = "Registration Failed, Password should be provided!"; } else { if ($password != $confirm_password) { $registration_failed = TRUE; $registration_message = "Registration Failed, Passoword doesn't match!"; } else { if (isset($username) && $real_image_code != md5($image_code)) { $registration_failed = TRUE; $registration_message = "You Image code is incorrect, Please correct it!"; } else { if ($username !== NULL && !empty($username)) { $rr = new RemoteRegistry(REGISTRY_ATOM_INTERFACE, ADMIN_USER, ADMIN_PASSWORD); $response = $rr->addUser($username, $password, $confirm_password, USER_ROLE, $friendly_name); if ($response == "200") { header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/thanks.php"); } else { $registration_failed = TRUE; $registration_message = "Registration Failed, Username already exist or entered fields are incorrect!"; } } } } } } } /* to generate the image */ define("IMAGE_WIDTH", 200); define("IMAGE_HEIGHT", 40);
//{ // echo "comment\n"; // echo "user: "******"\n"; // echo "text: ".$comment->text."\n"; //} //$response = $rr->getAverageRating("/test/test/mytest_file"); // //echo $response; //$response = $rr->getUserRating("/test/test/mytest_file", "dimuthu"); // //echo $response; //$response = $rr->applyTag("/test/test/mytest_file", "php1, php2, php3"); //$tags = $rr->getTags("/test/test/mytest_file"); // //foreach($tags as $tag) //{ // echo $tag."\n"; //} //$res = $rr->rateResource("/test", 5); //$res = $rr->getResourcePathsWithTag("amazon"); //print_r($res); /* $r1 = new Resource(); $r1->author_username = "******"; $r1->description = "This is a test"; $r1->content = "Again some test"; $r1->media_type = "text"; $res = $rr->put("/wso2registry/atom/test/test2", $r1); */ $res = $rr->addUser("dc", "dc", "user", "dc_"); print_r($res);