Joomla Cron for administration - joomla

In my website, I want to update data from external source everyday.
I create an administration module and he works manually but I need automate the process.
I think a cron can do that but the problem is the login ?
Joomla 3.

Set up the cronjob on the joomla server needs no login. Login is only needed via Http Requests, A cron job on the server dosent need a login (cron job on same server with joomla)
But as module it will not work. Why just hit a php script as cronjob?
A module needs joomla rendering in most cases and this will not work!

Related

Magento Manage customer not working after upgrade from 1.7 to 1.9

After i upgraded the magento from 1.7 to 1.9,
I am not able to access manage customer section from admin dashboard.
I am getting following error.
Gateway Time-out
The gateway did not receive a timely response from the upstream server
or application.
Edit:
If i clear the cache it works for the first time and then the issue will reappear if i try to access the manage customer section again.
check your installed extensions if you find any extension for manage customer then disable it and check after refresh cache.
This error generally comes when one server waits for response from another server for too much time. But it could be anything. What I would suggest you to check the Mage_Customer module and if it is enable try to remove log of the website as it make website slow. For removing the log try this
login to shell(SSH) panel and go to your website root/shell folder.
execute the below command inside the shell folder
php -f log.php clean

Drupal in Moodle sharing session

I have a Moodle site, in one of the Moodle pages I have an iFrame which contains a Drupal application. I want the Drupal application to see whether the user is logged in on Moodle, and if so show extra content.
However, I cannot access the session data from Moodle (especially information on the User) to in Drupal.
I tried two things:
If the iframe was a normal PHP page, I'd pass session_start(); on the top of the page in order for the session to persists, but I have no idea HOW to do that in Drupal.
And since they are on the same server, I tried accessing the config.php file in Moodle from a plain PHP file in the Drupal directory, and, as expect, I was able to get the variable. But as soon as I do this inside the Drupal application, a clash in function name between Moodle and Drupal threw an error.
The other option is to add a plugin in Moodle which sets a cookie on user login, a cookie that Drupal can get. But I'm really against this option since anyone can set a cookie and it persists. (There's no guarantee the user will click log-out)
I've never used/touched Moodle and Drupal until today. Can anyone help me figure out how to check whether a user is logged in on Moodle, from an iframe running a Drupal application?
A quick google gives the following moodle plugin that may be useful: https://moodle.org/mod/forum/discuss.php?d=208285
Looks like it allows single sign-on between the two, I've never used moodle before, but this may be a step in the right direction.

Access cakephp session (auth) from outside cakephp

I have a CakePHP website with its own login system using the Auth component. I would like to know if the following is possible:
A user has logged in and is navigating the website. At one point, he can click a link that opens an external php file. With external I mean that it could be in another folder of the same server, but outside the CakePHP app folders.
The "tricky" thing (for me) is to only show the contents of that php file if the user is logged in (to prevent someone without an account accessing those contents). I can't use Auth there because I'm "outside" Cake... I don't know if maybe using $_SESSION, but I don't know how...
Is this even possible? And yes, the php has to be outside the CakePHP app folder system.
Any ideas?
I'll add you also need to set session name to "CAKEPHP" using
session_name('CAKEPHP')
just before your external app session_start() otherwise you could not apply Kashif Khan suggested solution :)
Cheers,
Yes you can access the cakephp SESSION outside cakephp folder. try this session variable
$_SESSION['Auth']
if it exists then check for user here
$_SESSION['Auth']['User']
This is not working in Cakephp3. After calling
session_name("CAKEPHP");
session_start();
Application session is expiring.

how to run an admin task in joomla with a cron job?

I wrote a custom component in Joomla! that pulls in content from an XML feed and stores it in the Joomla database. I want the admin URL (/administrator/index?option=com_mycomp) to run via cron once every night to run the component. I can't figure out how to make this work, though, since the component is an administrator task and you have to be logged in to run it.
How do I get by this? I tried including my user/pw in the url (http:admin:password#www.mysite.com/joomla/administrator....) but it doesn't work. Is there anyway other way to send login credentials, or any other way to do this?
I know this thread is very old, but here's how I handled a similar task.
The "trick" is to take the custom PHP code you have created, and embed it into an article within your Joomla website.
I did this by using the JUMI extension, that allows custom PHP code to be stored within the Joomla repository and embedded, as required, within an article.
Then, create a CRON task that will activate the appropriate URL for the page containing the code you want to run.
Just put your script in the administrator directory of the component like
/administrator/components/com_yourcomponent/cron.yourcomponent.php
This is how FeedGator handles cron tasks [Sounds very similar to what you're trying to do.] ... you can also write a frontend controller in your component per one of the comments
========== [Update] ============
I created this ultra-simple installable component that could also be used for this purpose. It allows for a frontend menu item to be assigned to a php page (including the route as suggested). So you:
install the component
create new menu item, (may want to use a 'hidden' menu) select the 'show' view option and enter the script to run via cron in 'file to include' like path/yourcron.php
call the 'page' in your cron or test using: yourjoomlasite.com/index.php?option=com_show or yourjoomlasite.com/your-menu-alias
Mostly corn urls works from front-end even if your component deals with administrator only in Joomla.
So whatever your code in admin cron get it to front-end & so that your cronurl becomes like index.php?option=com_yourcomponent&task=cronjob.
Use this url to set cron using cPanel.
However this solution doesn't need to see whether admin is logged or not.

Magento 1.5.0.1 - Where does the Google Sitemap get created?

I am using Mangento 1.5.0.1 and have configured the admin section to export Google XML Sitemaps daily.
Mangento uses cron to execute this however the cron job runs but never outputs a sitemap nor does it email me an error.
I was thinking maybe I need to manually create the folders / files and then maybe they would then be populated by the cron job.
So my question is, where in the file system does Magento create these files?
Thanks
Paul
From memory I think sitemap.xml normally gets created in the Magento directory - usually whatever is the public root of your website. Of course this is configurable.

Resources