Suppose we have a Drupal site and an external application, and we want to use the same login for both. For example, we have an application which does something, but we have our users handled by Drupal, and we need to pass over to the application the information about the current user.

Basically we need to tap into our Drupal's user database table. We also need to use Drupal's $_SESSION, but Drupal stores its sessions in the database by default, and the $_SESSION superglobal remains empty. Instead, we need to use the global $user variable.

Taking this one step further, why not synchronize the logins? By synchronize I mean if we log in into Drupal, we get logged automatically into the application, and vice-versa, when we log in the application, we get logged into the Drupal site automatically . That way, if we navigate from app to Drupal, we don't have to relogin.
If you want a simple speedometer chart, and google's chart is just not what you want, here's a simple custom solution written in PHP. This should allow you to make any customizations you want.
If you're in the need of a bad-words validation, you might have thought first about an input filter, since Drupal is so into that. To put it simply, it's better to educate the users instead of having them censored.
Installation
  • install JasperServer - bundles java based applications (tomcat, ant) but also mySQL and iReports (don't need to install those on the server)
  • to work with the reports, you'll need to install it locally as well
  • to generate scheduled reports from php, enable SOAP extension for php (php.ini)
  • install SOAP and Net_Dime PEAR libraries for php
Generating a report
  • open IReports: add/create the SQL query, design & build the report
  • start jasper server (tomcat)
  • open jasper

If you host your site on a VPS or dedicated server, then you are able to tweak your server and make your site load significantly faster. The fallowing considers a LAMP platform but some parts might be useful for other platforms as well.

The first thing to consider is a PHP accelerator. I recommended eAccelerator. It will not make your site go significantly faster, but is one of those things that you have to have.

Second thing to do is a little database optimization.

If you want to restrict access to a directory, then think .htaccess and http authentication.
This is a solution when http authentication is not an option or if you want to restrict access to a single php script file.
It emulates regular http authentication with all the power & flexibility you get from php.
<?php
$username = 'admin';
$password = 'pass';

if ( !isset($_SERVER['PHP_AUTH_USER'])
     || !isset($_SERVER['PHP_AUTH_PW']) 
     || $_SERVER['PHP_AUTH_USER'] != $username
     || $_SERVER['PHP_AUTH_PW'] != $password ) {
  Header("WWW-Authenticate: Basic realm=\"My Protected Page\"");
  Header("HTTP/1.0 401 Unauthorized");
  echo '<html><body>
	   <h1>Rejected!</h1>
	   <big>Wrong Username or Password!</big>
	 </body></html>';
  exit;
}
?>
What needs to be done to make your site blazingly fast has never been easier. YSqow is a plugin for Firebug released by Yahoo. This tool gives you a good optimization report giving grades from F to A on 22 items from 6 categories: content, cookie, css, images, javascript, and server. In addition to grades and clear advices about what you need to do, it has a few interesting tools such as a compressor for css or javascript files which you can download and put in your site, or the images optimizer called Smushit.

So, Drupal 7.0 Alpha 3 has been released on 21 Mar 2010. That's very close to a Beta and a stable release.
That's very exciting news indeed.
Besides CCK, Views and a number of well established modules as a part of the core, it has a large number of improvements in terms of usability, security and performance. Unfortunately, looks like Panels, a very cool module that for basically doing complex visual layouts won't be a part of D7. Hopefully, a release for D7 as a standalone module will be available soon.

Syndicate content