<?php // Create and load client $user = UserFactory::registerUser('*****@*****.**', 'katesmith', 'Kate Smith'); // Create from invite and load client $user = UserFactory::registerUser('*****@*****.**', 'hannabrown', 'Hanna Brown', 'Default', 'katesmith'); // Create and load administrator $user = UserFactory::registerUser('*****@*****.**', 'johnsmith', 'John Smith', 'Administrator'); // Load user by email $user = new User('*****@*****.**'); // Load user by login $user = new User('johndoe', 'login'); // Check if subscription is valid $user->isSubscribed(); // Buy subscription via PayPal for 4 days Subscription::buy($user, 4, new PayPal(), $paymentDetails); // Buy subscription via PayPal for 10 days Subscription::buy($user, 10, new WebMoney(), $paymentDetails); // Load a product by title $product = new Product('TV'); // Load a product by ID $product = new Product(736); // Get product info $product->getProductInfo(); // Buy the product $order = $product->buy($user, new PayPal(), $paymentDetails); // Get order by ID $order = new Order(); $order->load(123); // Set different statuses of order $order->changeStatus(Order::ORDER_STATUS_CANCELLED);
} if (!file_exists($dojodir_dojo)) { echo $dojodir . "does not exist !<br>"; } if (!file_exists($dojodir_dijit)) { echo $dojodir . "does not exist !<br>"; } if (!file_exists($dojodir_dojox)) { echo $dojodir . "does not exist !<br>"; } //check the db connection $dba1 = new DatabaseAccess(); if ($dba1->checkDbConnection()) { $dba1->createTableStructure(); $uf1 = new UserFactory(); if ($uf1->registerUser($username, $password, "")) { echo "user created successfully<br/>"; //try to login $usr = application_loginuser($username, $password); if ($usr != null) { $df = new DirectoryFactory(); $df->login(); if ($df->createDirectory("trf_" . $usr->getUid())) { echo "user directory created successfully<br/>"; } else { echo "<b>could not create user directory you can do it manually<br/></b>"; echo "please create a directory called: trf_" . $usr->getUid() . "<br/>"; } $df->logout(); $uf1->createExampleGroup($usr); $uf1->createExamplePoi($usr);