Kunena 7.0.8 Released

The Kunena team has announce the arrival of Kunena 7.0.8 [K 7.0.8] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x./6.1.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question code for global display_name enabler

More
16 years 9 months ago #32309 by betahash
In the back-end configuration, you might set the Kunena to display either user-name or display-name. Anyhow, Kunena takes this setting in effect ONLY in the thread view.
In Categories-view or Forum-view, it will certainly be user-name on the page.

After all it is a security issue as well: user-name is exposed and the rest step is to guess the password.

I found this issue and solved it by myself. here is the code in Kunena.link.class.php - > function GetProfileLink
Code:
function GetProfileLink($fbConfig, $userid, $name, $rel='nofollow', $class='') { $fbConfig =& CKunenaConfig::getInstance(); // Only create links for valid users if ($userid > 0) { // query filter that might help to reduce sql load $keyword='='; // when $name is conducted as a link or anything non-name, there would be a "=". It might NOT be the most precise one , but during the test it appears to be the most obvious mark for me. if (strpos($name,$keyword)=== false) // notice: it is "===". { // all the vars are essential. Load Joomla user info. if ($fbConfig->username) { $fb_queryName = "username"; } else { $fb_queryName = "name"; } $kunena_db = &JFactory::getDBO(); $kunena_db->setQuery("SELECT b.name, b.username, b.gid FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'"); check_dberror("Unable to load name query."); // in some case this query cannot make it, especially when the database (user tables) for joomla and Kunena is not synchronized. And since this script is currently made by me, not an official release, it is useful to keep free of bugs as well. if ($userinfo == NULL) { // induced/copy from view.php. I think this should be NULL, but I haven't reviewed all the source code. $userinfo = new stdClass(); $userinfo->userid = 0;$userinfo->name = ''; $userinfo->username = ''; } $userinfo = $kunena_db->loadObject(); // For furture Compatibility:components (other than Kunena) might call this function for links to either display name or username, but you need a certain one. // also this helps to make this fuction more soild and reliable. if (($name==$userinfo->name)or($name==$userinfo->username)) {$name = $userinfo->$fb_queryName;} unset($kunena_db,$userinfo,$fb_queryName,$keyword); } // replace if($fbConfig->fb_profile == 'cb') { $kunenaProfile =& CKunenaCBProfile::getInstance(); if ($link = $kunenaProfile->getProfileURL($userid)) { return CKunenaLink::GetSefHrefLink($link, $name, '', $rel, $class); } else { return $name; } } else { return CKunenaLink::GetSefHrefLink(KUNENA_PROFILE_LINK_SUFFIX.$userid, $name, '', $rel, $class); } } else // supress links for guests { return $name; } }
Requirement : php-extension mbstring must be enabled, in which strpos() is described.

You can safely replace the function with mine. Anything I changed is commented within the code.

Please Log in or Create an account to join the conversation.

Time to create page: 0.208 seconds