# uname -a

Switch

Mot-clé -

Fil des billets

lundi 10 novembre 2014

Drupal 7 : change page title on node form

Every rule has its exceptions, setting drupal_set_title directly on form_alter doesn’t work for node form title. To customize pages like “Add node”, or “Edit node” :

  • Make a module

  • Add a function to implement hook_form_alter

  • Add a form afterbuild in your hook_form_alter implementation: $form['#after_build'][] = '_my_callback_form_set_title'

  • In '_my_callback_form_set_title', use drupal_set_title to change the form title: drupal_set_title(...)

  • Update system table to have the weight of your module greater than Node module (on a default install, core modules are weighted 0, so set your module weight to 1).

  • Rebuild registry, clear caches.

samedi 29 juin 2013

osTicket, wget, crontab and FastCGI

After a long night trying to get HTTP cron for osTickets to work, here is my solution :

Things to know

  • Rewritting the URLs of a FastCGI-running PHP application, using Apache2 mod_rewrite on PATH_INFO is broken, it does not work. Never.
  • osTicket needs POST requests to its API.
  • osTicket uses an unsafe way to get PATH_INFO, obviously it will not work with FastCGI.

How to get it work

Open includes/class.osticket.php

Replace :

        //TODO: conruct possible path info.


With :

        $path_info = str_replace(BASE_URI."/", "", $_SERVER['REQUEST_URI']);
        if (!empty($path_info))
                return $path_info;

And call the cron like that :

 /usr/bin/wget -q --no-cache -O /dev/null --post-data '' --header='X-API-Key:your_api_key_here' 'http://example.com/api/http.php/tasks/cron'

mardi 6 avril 2010

C99Shell et dé-obfuscation

Ayant eu récemment l'occasion de travailler sur un site s'étant fait own3d par un script kiddie via la faille phpMyVisites, j'ai eu l'occasion d'essayer C99Shell, l'outil qui était utilisé par ces derniers pour accéder au backend du site.

Lire la suite...

page 2 de 2 -