<?php
/**
* Installatron Control Panel Integration API
* backend.php template
* Date: 2008-12-31
*
* Documentation: http://installatron.com/controlpanelapi
* Support: https://secure.installatron.com/tickets
*
* This template includes only the required methods for a "user-centric"
* control panel setup. For more methods, see the documentation.
*/
class i_custom extends i_panel
{
	/**
	 * The control panel name.
	 *
	 * @return  string   Control panel name
	 */
    public function getName()
	{
		return "Your Control Panel";
	}

	/**
	 * The control panel version.
	 *
	 * @return  string   Control panel version
	 */
	public function getVersion()
	{
		// YOUR CODE HERE
		return $version;
	}

	/**
	 * Information about a user.
	 *
	 * @param   string  Username of user
	 * @return  array   User information array
	 */
	public function getUser($u)
	{
		$r = array();
		// YOUR CODE HERE
		return $r;
	}

	/**
	 * Users owned by a reseller.
	 *
	 * @param   mixed  Reseller username
	 * @return  array  List of users
	 */
	public function getUsers($u)
	{
		$r = array();
		// YOUR CODE HERE
		return $r;
	}

	/**
	 * Domains owned by a user.
	 *
	 * @return  array  List of "effective" user's domains
	 */
	public function getDomains()
	{
		$u = itron::$session["effective_user"];

		$r = array();
		// YOUR CODE HERE
		return $r;
	}

    /**
     * Install location as a server path.
     *
     * @param   string  "http" | "https"
     * @param   string  Domain part of the install URL
     * @param   string  Path part of the install URL
     * @param   string  Sub-domain part of the install URL
     * @return  string  Server path to the install location
     */
    public function getInstallPath($httphttps, $domain, $path, $subdomain)
    {
        // YOUR CODE HERE
        return $installPath;
    }

    /**
     * Databases owned by the effective user.
     *
     * @param   string  Database type
     * @return  array   User's databases
     */
	public function getDBs($type)
	{
		$u = itron::$session["effective_user"];

		switch($type)
		{
		case "mysql":
			$r = array();
			// YOUR CODE HERE
		}
		return $r;
	}

    /**
     * Create a database
     *
     * + If your panel requires each database name and username
     * start with the control panel user's username, note that the
     * incoming $name value does not have the username prepended.
     *
     * @param   string  New database name +
     * @param   string  New database username +
     * @param   string  New database username's password
     * @param   string  Database type (must be "mysql")
     * @param   string  New database host (as originally returned by getUser(effective_user).mysql_host).
     * @return  bool    true if sucessful; false otherwise
     */
	public function createDB($name, $user, $pass, $type, $host)
	{
		switch($type)
		{
		case "mysql":
			// YOUR CODE HERE
			return true;
		}
		return false;
	}

    /**
     * Remove a database.
     *
     * If database usernamess are tied to database names,
     * the database username can also be removed.
     *
     * @param   string  Name of database to be removed
     * @param   string  Database type
     * @param   string  New database host (as originally returned by getUser(effective_user).mysql_host).
     * @return  bool    true if sucessful; false otherwise
     */
    public function removeDB($name, $type, $host)
    {
        switch($type)
        {
        case "mysql":
            // YOUR CODE HERE
            return true;
        }
        return false;
    }

}
?>