I got this error while creating a joomla logout link. Here is my code please help
if($user->id){
$token = JUtility::getToken();
$linkout = JRoute::_("index.php?option=com_users&task=user.logout&".$token."=1");
}
and echo $linkout to anchor tag
JUtility::getToken() has been replaced by JSession::getFormToken(), thus code could be changed to:
&task=user.logout&<?php echo JSession::getFormToken(); ?>=1">
you may want to use this for further reference:
joomla 3 and joomla platform 12.2 potential backward compatibility issues
Related
My project is using three different services and now I never can get sessions values, I've tried the laravel site tutorial and fallowing link question :
Laravel - Session returns null
But none of them worked!
In the first, i used this library:
use Session;
In a controller class :
$result = SocketHelper::sendRequest($req);
Session::put('uuid', $result->uuid);
Session::save();
Session::put('userId', $result->userID);
return Redirect::route('login_step_two');
In an other method :
$uuid = Session::get('uuid');
$userId = Session::get('userId');
But these are null! does I have to use cookie?
I recently upgrade to laravel 5.4
Please help me! It's made me confused!
Thanks.
Try saving Session explicitly like this, give it a try it worked for me, hope same for you.
Session::put('test_session', 'test message');
Session::save();
And retrieve it like this
echo Session::get('test_session');
And forget it like this:
Session::forget('test_session');
Session::save();
I understood the null result was becouse I was posting the value of $request to an other template and it was changed it the way :))) !
so easy to know !
Have you properly upgraded to laravel 5.4?
Laravel Docs
Sessions
Symfony Compatibility
Laravel's session handlers no longer implements Symfony's SessionInterface. Implementing this interface required us to implement extraneous features that were not needed by the framework. Instead, a new Illuminate\Contracts\Session\Session interface has been defined and may be used instead. The following code changes should also be applied:
All calls to the ->set() method should be changed to ->put(). Typically, Laravel applications would never call the set method since it has never been documented within the Laravel documentation. However, it is included here out of caution.
All calls to the ->getToken() method should be changed to ->token().
All calls to the $request->setSession() method should be changed to setLaravelSession().
Do you still have the rights to write session files in php session directory ?
Check the path returned by session_save_path() and check if your php user has the rights to write in it, check also if there is files in the directory and what are their creation date.
When I type an invalid url (non-existent controller), it displays the homepage rather than return a 404 Page Not Found page. Does anyone know the possible reason?
Thanks
Have checked if there is any plugins are registered in the bootstrap and if is it configured to catch the exceptions or set any ACL mechanisms.
Also check the error controller too. may be there is some forwarding methods implemented there.
Hi i've had the same problem and i now know how to fix it:
within the bootstrap have the following init
function _initModules()
{
$this->bootstrap('frontController') ;
$front = $this->getResource('frontController') ;
$front->addModuleDirectory(APPLICATION_PATH . "/modules");
$front->setParam("useDefaultControllerAlways", false);
}
Setting 'useDefault....' will use the default controller when a 404 occurs.
You should also make sure your error controller is setup correctly
We have an ecommerce magento store. Right now, we are experiencing a weird problem, which i am unable to understand and debug.
For some of the orders, no details are displayed in the order details page of magento admin, though the mail is correctly sent to the client and cc'd to our email id.
Screenshot for admin order details page :-
Screenshot for email containing order details :-
Why is this happening ?? I tried to check the pattern but was unable to. Please help me on this issue as i am not a pro in magento and any help from your side will do the work for me.
Try also this, it worked for me (from https://magentary.com/kb/php-syntax-error-after-supee-7405-unexpected/):
Problem description
After SUPEE-7405 patch Sales Order Management screen in Magento Backend is blank or the following error is reported in PHP error log:
PHP Parse error: syntax error, unexpected '[' in app/code/core/Mage/Adminhtml/Helper/Sales.php on line 124
Cause
SUPEE-7405 is prepared with PHP 5.4 in mind, older PHP versions are incompatible with new language constructions used.
Solution
Change line 124 in app/code/core/Mage/Adminhtml/Helper/Sales.php from $links = []; to $links = array();:
--- app/code/core/Mage/Adminhtml/Helper/Sales.php
+++ app/code/core/Mage/Adminhtml/Helper/Sales.php
## -121,7 +121,7 ##
public function escapeHtmlWithLinks($data, $allowedTags = null)
{
if (!empty($data) && is_array($allowedTags) && in_array('a', $allowedTags)) {
- $links = [];
+ $links = array();
$i = 1;
$data = str_replace('%', '%%', $data);
More than likely you have a local or community module causing some kinds of fault, if the page is not rendering all the way for some orders, I would presume these are orders that are using this local and/or community module.
A few things you can try are:
1) disable all local modules via local.xml
2) disable community modules via app/etc/Company_Modulename.xml and set active to false
after disabling each retry viewing the orders until you find the culprit.
Also, viewing the page source may help lead to where the output is stopping and there also may be errors at the very end of the page source.
hope this helps.
I solved this problem when I replace the tax.phtml file in
app/design/adminhtml/default/default/template/sales/order/totals
with my original file. Try it.
I disabled all plugins. It seemed that the apptha one step checkout plugin was responsible for this in my case.
I believe that this issue is due to default Magento, as the files does not point to any third party checkout extensions.
If the SUPEE-7405 patch has caused this, please check that your system does not run on PHP 5.3.
The patch breaks PHP 5.3 compatibility, by introducing usage of array literals in app/code/core/Mage/Adminhtml/Helper/Sales.php (line 124), which became available in PHP since version 5.4, so the minimum PHP version required, after applying it, is PHP 5.4:
// patched app/code/core/Mage/Adminhtml/Helper/Sales.php lines 121-124
public function escapeHtmlWithLinks($data, $allowedTags = null)
{
if (!empty($data) && is_array($allowedTags) && in_array('a', $allowedTags)) {
$links = [];
To fix this, and restore PHP 5.3 compatibility (allowing orders to show up again in admin screens), simply correct this with old PHP5.3 equivalent:
// patched and fixed app/code/core/Mage/Adminhtml/Helper/Sales.php lines 121-124
public function escapeHtmlWithLinks($data, $allowedTags = null)
{
if (!empty($data) && is_array($allowedTags) && in_array('a', $allowedTags)) {
$links = array();
Change PHP 5.3 to 5.6 on your Server , logout and in . Resfresh you Cache.
It will be run.
For the Version 1.9.2.3 magento.
I have a CodeIgniter site that I just migrated from php4 to php5 and 1.7.2 => 2.0. Now I am getting this error:
Fatal error: Call to undefined function decrypt() in path_to_file/global/utility.php on line 7
Line in question:
$isAdmin = isset($login[3]) ? (decrypt($login[3])=="1" ? true : false) : false;
Any ideas?
It looks like it may be part of a helper of other library that you didn't port over. Tank_Auth and ion_auth utilize the built-in CI encryption methods so my guess is that someone created a custom decrypt function somewhere that has not been ported over or called in your new version. Perhaps there is a missing entry in your autoload config.
Also, you will likely need to re-encrypt the encrypted data as stated in the user guide encryption manual referenced by ajreal.
I am having trouble getting a working Codeigniter version 2.0.3 with hmvc and tank auth(set up as a module) setup properly. I have installed CI properlly and then install HMVC with these directions https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home
I get to my welcome controller/view as example just fine which means the HMVC is working. Next I try to add tank auth to the project by adding it to a folder in the modules folder. It has the proper controller/view/model etc.. setup within the tank auth. I even added in routes something like
$route["auth"]="auth/login";
I also extended the controller within the auth module to MX_Controller like as directed. Also in the constructor I have :
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->library('security'); <--failing to load this
$this->load->library('tank_auth');
$this->lang->load('tank_auth');
$this->form_validation->CI =& $this;
It seems to be redirecting fine to the module however it comes up with an error saying ::
An Error Was Encountered
Unable to load the requested class: security
What am I doing wrong? Does any one have a working CI installation with HMVC and tank auth as a module so I can see how its done? I'm new to HMVC, thanks
I found the same problem, but i solved by simple adding a comment to the
$this->load->library('security');
so it will look like this:
//$this->load->library('security');
since security its now part of the codeigniter core, i guess its already loaded by default, and everything seems to be working pretty good
it is in Helper now according to CodeIgniter 3.0 user guide
try:
$this->load->helper('security');
I fix this, by creating Security.php file in application/libraries directory with the following code:
require_once(BASEPATH.'core/Security.php');
class Security extends CI_Security { }
I found a solution, I simply took the security.php file from codeigniters system/core folder and dropped it into system/libraries.
move the file security.php from system/core to system/libraries
then edit core/codeigniter.php line number 204 from $SEC =& load_class('Security', 'core'); to $SEC =& load_class('Security', 'libraries');
Security.php is present in "codeigniter/system/core/Security.php"
so provide this path your problem gets solved easily
load->library('../core/security');
I Read CodeIgniter 3.X User Guide and I was found that "Security" is available as a 'helper' Now.
So you need to change this;
$this->load->library('security');
into
$this->load->helper('security');
XSS Filtering
The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:
$config['global_xss_filtering'] = TRUE;
You need to read a CodeIgniter 3.0 User Guide there are so many changes and implementation or please Refer change log.