Joomla

Best way to prevent SQL injections in Joomla

吃可爱长大的小学妹 提交于 2020-01-23 06:19:12
问题 I take variables from POST method and query them on MySQL with Joomla 2.5. What is the most secured method to use ? Currently I'm using JRequest::getVar with mysql_real_escape_string. Is it correct ? $_POST with mysql_real_escape_string $password = mysql_real_escape_string($_POST["pwd"])); JRequest::getVar with mysql_real_escape_string $password= mysql_real_escape_string(JRequest::getVar('pwd', '', 'post')); JRequest::getVar $password= JRequest::getVar('pwd', '', 'post'); JInput $password =

Tutorial code is not working any more in Joomla 2.5

淺唱寂寞╮ 提交于 2020-01-23 03:32:25
问题 I followed a tutorial from the Joomla developer wiki (http://docs.joomla.org/Developers#Developing_a_Model-View-Controller_.28MVC.29_Component_2) to create a Joomla component. It all worked fine in Joomla 1.7, but when I upgraded to Joomla 2.5 the checkboxes in the backend are not working any more. I checked the code from http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.7_-_Part_09#Adding_a_toolbar in Joomla 2.5 extensions and the boxchecked hidden field

Joomla setRedirect doesn't work

会有一股神秘感。 提交于 2020-01-22 16:52:24
问题 I have a simple Joomla controller, but I can't redirect anything. According to the documentation: class MyController extends MyBaseController { function import() { $link = JRoute::_('index.php?option=com_foo&ctrl=bar'); $this->setRedirect($link); } } //The url contains & html escaped character instead of "&" This should work, but I get a malformed URL. Is there something I'm missing here? Why is Joomla converting all the "&" characters into & 's? How am I suppose to use setRedirect? Thank you

Add page-specific javascript or CSS in Joomla

安稳与你 提交于 2020-01-21 03:50:06
问题 How do you include a javascript or CSS file only on a certain article in Joomla? I have one article which requires the jQuery UI and associated theme. Since this isn't being used on any other pages, I only want it for this particular article. Adding in the necessary <script> and <link rel="stylesheet"> tags in the HTML of the article doesn't work, since they get stripped out when saved. If there was a method to include certain files, or to stop the stripping of those tags, that'd be really

How to redirect user after login in Joomla 2.5

天涯浪子 提交于 2020-01-17 08:41:06
问题 I have created custom Login module in Joomla 2.5 which appears using fancybox. Our site is using SEF URL. Now my problem is user is not redirecting to previous page where popup is trigger. I have used following code in my module and passed it to "return" parameter of login form. $uri =& JFactory::getURI(); $redirectUrl = urlencode(base64_encode($uri->toString())); <input type="hidden" name="return" value="<?php echo $redirectUrl; ?>" /> But it redirect with some value appended at the end of

JPG, png and gif “This file type is not supported” in joomla 3.2.1

送分小仙女□ 提交于 2020-01-17 07:21:22
问题 Is it me or is this the new joomla release? It worked fine in 3.2 as far as I remember. I tried png as well and gif. Different filenames. For the unbelieving people, Legal extensions is: bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,swf,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,SWF,TXT,XCF,XLS for me 回答1: I tried uploading an image named java.jpg like your screenshot and it didn't work, then I tried php.jpg and didn't work as well. The same images with

Editing the logo link destination in joomla (yootheme warp 7)

天大地大妈咪最大 提交于 2020-01-17 03:52:05
问题 I'm trying to edit the default logo link destination in joomla (using yootheme's warp 7). Currently it links to the default homepage, whereas I'd like it to link elsewhere. I can edit the logo's CSS just fine, and I can also access the module that contains the logo. However, the link seems to be wrapped around the module itself. <a class="tm-logo" href="mysite.html"> <div class="mysite-logo"> <img alt="My Website" src="/mysite/images/yootheme/demo/default/logo.svg"></img> </div> If I could

Joomla: get the user group from the page access level using PHP

a 夏天 提交于 2020-01-16 18:31:21
问题 In Joomla 2.5.16: Suppose user 100 belongs to user groups 14 and 16. Suppose that the page he's currently viewing has an access level id of 6. According to the table 'viewlevels' in the MySQL database, access level 6 is available for groups 8, 16 and 17 My goal is to find the "right" user group for this page. Since the user belongs to 2 user groups and one of them (16) is contained in the array of groups allowed to see this page, how can I query the database to find that group? I tried: $usr

XAMPP v1.7.4 installation issues,local host not working

坚强是说给别人听的谎言 提交于 2020-01-16 18:25:08
问题 I had an older version on XAMPP and it was working fine. I uninstalled it to install the new version.Since then local host has stopped working. XAMPP control panel says Apache and MySQL running.Can some one help please? I have got this in the httpd-vhosts.conf,do i make any changes here? ##<VirtualHost *:80> ##ServerAdmin postmaster@dummy-host.localhost ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost" ##ServerName dummy-host.localhost ##ServerAlias www.dummy-host.localhost ##ErrorLog

Joomla! Custom form logs the user out on submission

核能气质少年 提交于 2020-01-16 08:00:11
问题 I have the following php embedded into a Joomla! article, using the Sorcerer plugin; <?php $user = JFactory::getUser(); $username = $user->username; $user_id = $user->id; if (isset($_GET['action'])){ date_default_timezone_set('Europe/London'); $user= JFactory::getUser(); $username=$user->username; $user_id=$user->id; $date_now=date('m/d/Y H:i:s'); $db =& JFactory::getDBO(); $insert_sql= "INSERT INTO KOSRequest (user_id,created,IGN,LKL,KOSReason,Status) VALUES (".$user_id.",'".$date_now."','".