Location: PHPKode > projects > Content*Builder > contentbuilder/plugins/myCB/plugins/userData/userData.inc.php
<?php
	/*
	* Sprachdateien einbinden
	*/
	/* User Sprachdateien laden. Default: englische Version */
	file_exists($lang_path.$lang_pf."/plugin/user.lang.php") ? 
		include($lang_path.$lang_pf."/plugin/user.lang.php") : 
		include($lang_path."en/plugin/user.lang.php");
	$tpl->assign("userTextMessages", $usr_msg);
	
	/*
	* Initialisieren des Optionen Objekts für den aktuellen 
	* User und seine Optionen.
	*/
	$editUserOption = new CBOption($cbUserID);
	$editUserOption->setModule("user");
	$editUserOption->getOptionList();

	$myCBUserRow = mysql_fetch_assoc(mysql_query("SELECT profile.company, profile.city, profile.street, profile.tel, profile.fax, profile.icq, profile.describt, profile.website, profile.skills, profile.birthday, profile.portraitID, user.* FROM ".TABLE."_user AS user LEFT JOIN ".TABLE."_profile AS profile ON user.userid = profile.userid WHERE user.userid = '$cbUserID'"));
	foreach($myCBUserRow as $k => $v) {
		$myCBUserRow[$k] = stripslashes($v);
	}
	
	/*
	* Update Bereich
	*/
	// Beginn Verarbeitung Plugin Whitelist
	if(isset($myCBPermanentWhitelistUpdate)) {
		$_tempWLString = "";
		if(is_array($permanentWLValues)) {
			$multiple = false;
			foreach($permanentWLValues as $v) {
				if($multiple) {
					$_tempWLString .= "|^|";
				}
				$_tempWLString .= $v;
				$multiple = true;
			}
		} else {
			$_tempWLString = "noPermanent";
		}
		$editUserOption->updateOption("permanentWhitelist", $_tempWLString, $cbUserID);
		$editUserOption->getOptionList();
		
		$editPermanentWhitelist = explode("|^|", $_tempWLString);
		header("Location: ".$REQUEST_URI);
		exit;
	}
	
	/*
	* Passwort Update ... User möchten selber vielleicht das Passwort neu setzen
	*/
	if(!empty($myCBPassUpdate)) {
		$myCBPass = "";
		if($myCBPass1 == $myCBPass2) {
			$myCBPass = md5($myCBPass1);
			$usrUpdate = mysql_query("UPDATE ".TABLE."_user SET passwort = '$myCBPass' WHERE userid = '$cbUserID'");
		} else {
			$errorList[] = $usr_msg["passwords_dont_match"];
		}
	}
	
	/*
	* Profil Update
	*/
	if(!empty($profileUpdate)) {
		$checkProfile = mysql_query("SELECT userid FROM ".TABLE."_profile WHERE userid = '$cbUserID'");
		if(mysql_num_rows($checkProfile) == 0) {
			$profileInsert = mysql_query("INSERT INTO ".TABLE."_profile (userid) VALUES ('$cbUserID')");
		}
		
		if(!ereg("(^[1-9]?[0-9]*$)", $icq)) { 
			$icq = ""; 
			$errorList[] = $usr_msg["invalid-icqnr"];
		}
		
		$isIntArr = array ( "birthYear", "birthMonth", "birthDay", "icq" );
		foreach($isIntArr as $v) {
			if(!ereg("(^[1-9]?[0-9]*$)", $_POST[$v])) { 
				$_POST[$v] = ""; 
			}
		}
		
		$thisBirthday = $_POST['birth_year']."-".$_POST['birth_month']."-".$_POST['birth_day'];
		
		$profileUpdate = mysql_query("UPDATE ".TABLE."_profile 
			SET company = '$company', 
				city = '$city', 
				street = '$street',  
				tel = '$tel',
				fax = '$fax',     
				icq = '$icq',
				website = '$website', 
				describt= '$description',
				skills = '$skills',
				birthday = '$thisBirthday'
				WHERE userid = '$id'"
		);
	}
	
	/*
	* Permanent White List Feature. Welche Permanents will der 
	* User sehen?
	* 
	* $permanentWhitelist wurde schon in der main.php gesetzt
	*/
	
	// Permanent Plugins werden in der main.php bereits abgerufen
	if($permanentPlugins != false) {
		$editPermanentWhitelistString = $editUserOption->getSingleOption("permanentWhitelist");
		$editPermanentWhitelist = explode("|^|", $editPermanentWhitelistString);
		foreach($permanentPlugins as $v) {
			/* 
			* Wenn Name im Language Array abgelegt ist, nimm diesen, 
			* ansonsten den, den das Plugin angegeben hat
			*/
			if($lang_plugin_plugin[$v->getValue("ident")] != "") {
				$editPermanentWLName[] = $lang_plugin_plugin[$v->getValue("ident")];
			} else {
				$editPermanentWLName[] = $v->getValue("name");
			}
			
			if(in_array($v->getValue("ident"), $editPermanentWhitelist)) {
				$editPermanentWLSelected[] = "checked";
			} else {
				$editPermanentWLSelected[] = "";
			}
			
			$editPermanentWLIdent[] = $v->getValue("ident");
		}
		
		$tpl->assign("whitelistPermanentRow", 
			array ( "PERMNAME" => $editPermanentWLName,
					"PERMID"   => $editPermanentWLIdent,
					"SELECTED" => $editPermanentWLSelected
			)
		);
		$tpl->assign("whitelistPermanent",
			array(  "USERNAME"     => $mUser->name." ( ".$mUser->fullname." ) ",
					"VAL_USRID"	   => $id
			)
		);
		$tpl->assign("whitelistPermanentSet", "1");
	}
	
	$myCBContent[mainContent][set]     = 1;
	$myCBContent[mainContent][content][] = $tpl->fetch($config['templates']."plugins/".$actualMyCBPlugin."/userData.template", null, "pluginmyCB".$cbUserID);
?>
Return current item: Content*Builder