<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

/**
*
* @package simpleMembership
* @copyright Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Anton Getman(ljanton@mail.ru);
* Homepage: http://www.ordasoft.com
* @version: 1.2 FREE
*
**/




class mos_alUserOthers{
	/**
	 * Sets the parametes for connecting to a webservice via a 
	 * @param the array of parameters
	 */
	function setParams()
	{
		global $user_configuration;
		// Prepare settings
		// Using single quotes is easier because you don't have to escape them. For every setting, add a line.

    $settings = "<?php\n";
		$settings .= "// Do not edit this file. Generated by admin script.\n";
		$settings .= "// simplemembershiplibrary Configuration file\n";
		$settings .= "\$user_configuration['release']['version']='" . $user_configuration['release']['version'] ."';\n";
		$settings .= "\$user_configuration['release']['date']='" . $user_configuration['release']['date'] ."';\n";
		$settings .= "\$user_configuration['acl_group_set']='" . $user_configuration['acl_group_set'] ."';\n";
		$settings .= "\$user_configuration['acl_group_set_email']['show']='" . $user_configuration['acl_group_set_email']['show'] ."';\n";
		$settings .= "\$user_configuration['useradd_notification_email']='" . $user_configuration['useradd_notification_email'] ."';\n";
		$settings .= "\$user_configuration['preregister']='" . $user_configuration['preregister'] ."';\n";
		$settings .= "\$user_configuration['activationmsg']='" . $user_configuration['activationmsg'] ."';\n";
		$settings .= "\$user_configuration['admin_created_msg']='" . $user_configuration['admin_created_msg'] ."';\n";
		$settings .= "\$user_configuration['user_created_msg']='" . $user_configuration['user_created_msg'] ."';\n";
		$settings .= "\$user_configuration['user_enabled_msg']='" . $user_configuration['user_enabled_msg'] ."';\n";
		$settings .= "\$user_configuration['user_approve_msg']='" . $user_configuration['user_approve_msg'] ."';\n";
		$settings .= "\$user_configuration['user_disapprove_msg']='" . $user_configuration['user_disapprove_msg'] ."';\n";
    $settings .= "\$user_configuration['default_group']='" . $user_configuration['default_group'] ."';\n";
    $settings .= "\$user_configuration['other_profiles']='" . $user_configuration['other_profiles'] ."';\n";
    
    $settings .= "?>\n";
		// Write out new initialization file
		$fd = fopen("./components/com_simplemembership/admin.simplemembership.class.conf.php", "w" )
		or die ("Cannot create configuration file.");
		fwrite( $fd, $settings );
		fclose( $fd );
	}
	/**
	 * Rating Array
	 * @return array an Array containing the information of all Rating
	 * possibilities
	 */
	function getRatingArray(){
		$i = 0;
		$retVal = array();
		while($i < 5){
			//erster teil x,0
			$tmp = $i * 2;
			array_push($retVal, array($tmp, $i.",0"));
			//zweiter teil x,5
			$tmp ++;
			array_push($retVal, array($tmp, $i.",5"));
			$i ++;
		}
		array_push($retVal, array(10, "10,0"));
		return $retVal;
	}
	/**
	 * Language Array - defined in the language files!
	 * @return array an Array containing the information of all Language
	 * possibilities
	 */
	function getLanguageArray(){
		$retVal = array();
		array_push($retVal, array("Not specified", _SIMPLEMEMBERSHIP_LANGUAGE_NOT_USED));
		array_push($retVal, array("English", _SIMPLEMEMBERSHIP_LANGUAGE_ENG));
		array_push($retVal, array("Russian", _SIMPLEMEMBERSHIP_LANGUAGE_RUS));
		return $retVal;
	}
}
?>
