Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/web-klick.de/dsh/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/web-klick.de/dsh/howto_1021_drupal.md

<CENTER>
<TABLE><TR><TD>
<img src="iftlogo1.svg" width="220"/>
</TD></TR></TABLE>

Drupal
======

Content Management System for Web Sites
---------------------------------------

<br/>
Tutorial 1021, 20.10.2016
<br/>
<br/>
IfT Informatik GmbH  
Nürnberger Str. 134  
D-90762 Fürth  
0911/3000 61-35  
</CENTER>


<p class="break"/><div class="header">Content Management Systems</div **********************************>


1.   Content Management Systems
===============================


1.1.  General
-------------


-   A *Content Management System* manages content which is represented as HTML-pages in a browser.

-   The *Website*: all of the CMS's pages collected together ('site')


<p class="break"/><div class="header">Static vs Dynamic CMS</div ******************************************>


1.2.   Static Content Management Systems
----------------------------------------

-   The pages are:

    *  statically written &nbsp;  *OR*

    *  or generated in a compiling process to static HTML, CSS, JS

-   Advantage: Fast and secure

-   Examples:

    *   Pelican

    *   self-generated HTML

    *   ....


<p class="break"/><div class="header">Static vs Dynamic CMS</div ******************************************>


1.3.   Dynamic Content Management Systems
-----------------------------------------

-   Data-based. The content is stored in a database.

-   Pages are dynamically created on client requests.

-   Can be speeded up by caching and compressing.

-   Advantage: Dynamic user managements, configurable.

-   Examples:

    *   Wordpress

    *   Joomla

    *   Drupal


<p class="break"/><div class="header">Drupal -- Why</div **********************************>



1.4.   Why a dynamic CMS, and why Drupal?
=========================================


-   Supported Data-bases:

    *   MySQL

    *   MariaSQL

    *   SQLite (can be stored directly th the website's directory itself,
        and therefore, can be copied together with it)

-   A Drupal site can render a complete static version of the site.

    So if you like, you can regard Drupal as a generator for a static web site.

-   Drupal 8 now is mature, and it brings theming into practical use now.




<p class="break"/><div class="header">Drupal -- Installation</div **********************************>


2. Installation of Drupal for Ubuntu 16.04
==========================================

2.1. Getting packages
---------------------

    apt-get install -y apache2 php php-gd php-xml
    apt-get install -y sqlite3 php-sqlite3
    apt-get install -y libapache2-mod-php php-mysqlnd
    apt-get install -y php-intl php-pear
    apt-get install -y php-imap php-mcrypt php-memcache
    apt-get install -y php-ming php-curl php-imagick
    apt-get install -y php-ps php-pspell php-recode
    apt-get install -y php-snmp php-tidy php-mbstring
    apt-get install -y php-xmlrpc php-xsl php-apcu
    apt-get install -y certbot python3-certbot-apache

*Optional:*

    apt-get install -y mysql5 mysql-common
    apt-get install -y mysql-server mysql-client


<p class="break"/><div class="header">Drupal -- Apache</div **********************************>


2.2.  Customize Apache
----------------------

Be aware to have enabled in `/etc/apache2/apache2.conf`:

    Include sites-enabled/*

Execute:

    a2enmod rewrite ssl
    /etc/init.d/apache2 restart


Restart Apache:

    /etc/init.d/apache2 restart

Define so-called 'www-users' by putting them in the `www-data`-group in `/etc/group`.


<p class="break"/><div class="header">Drupal -- Customize PHP</div **********************************>


2.3.  Customize PHP
-------------------

Set the variables in `/etc/php/x.y/apache2/php.ini` so that:

    memory_limit = 512M
    max_execution_time = 600
    max_input_time = 600


Restart Apache:

    /etc/init.d/apache2 restart


<p class="break"/><div class="header">Drupal -- Drush</div **********************************>


2.4.  Drush --- Drupal's Command Line Interface
-----------------------------------------------

`drush` is a command line interface to the Drupal sites which is able to:

-   Install, enable and disable modules and caches

-   Clearing caches

-   Getting site info

-   Perform backups

-   update, and many other actions

Drush is to set up only once at each host.

*IMPORTANT:*  `apt-get install drush` does not get the proper version!

So we have to go another way:

<p class="break"/><div class="header">Drupal -- Install Drush</div **********************************>

Install Drush
-------------

-   Install the appropriate phar-file for drush:

-   Download it from `https://github.com/drush-ops/drush/releases.` Search for 8.3.5.

-   Put this file under the name `drush835.phar` into `/usr/local/bin`.  
    (Replace 835 by the actual version number you find).

-   Create a file `\usr\local\bin\drush813` with content:

        php drush835.phar $1 $2 $3 $4 $5`

-   Make both files `drush835.phar` and 'drush835`executable in `usr\local\bin`.

-   Now you have `drush835`as a command line interface (CLI) for Drupal.

-   If there are issues with drush, check whether installing further php extensions will help.




New:

composer global require drush/drush:10.x

Put ~/.config/composer/vendor/bin into the path.

composer create-project drupal/recommended-project:9.x  site_name_dir
composer require --dev drush/drush


drush10  site:install --db-url sqlite://sites/default/.ht.sqlite

get the outdated modules:   composer outdated "drupal/*"
update the mnodules:        composer update "drupal/*"

composer require drupal/adaptivetheme
composer require drupal/at_tools
composer require drupal/at_core
composer require drupal/at_theme_generator

composer update drupal/module --with-dependencies





<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Create</div **********************************>


3.  Setting up a fresh drupal site:
===================================

3.1.  Creating the site's directory in /var/www
-----------------------------------------------


-   Choose a name `<your_drupal_site>` and execute in `/var/www`:

        drush835 dl drupal-8
        mv drupal-8.x.y <your_drupal_site>
        cp <your_drupal_site>/sites/default/default.settings.php
            ....  <your_drupal_site>/sites/default/settings.php
        mkdir <your_drupal_site>/sites/default/files
        mkdir <your_drupal_site>/sites/default/files/translations
        sudo chown -R <www-user>:www-data <your_drupal_site>
        sudo chmod -R g+rwx <your_drupal_site>/sites/default

<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Activate</div **********************************>


3.2.  Activate the site in Apache
---------------------------------

-   Choose port number <port> (example: 8033) and enable the site in a file:
    
        /etc/apache2/sites-available/<your_drupal_site>.<domain_name>

    with the content:

        <VirtualHost *:<port> >
            DocumentRoot   /var/www/<your_drupal_site>
            ServerName     <your_drupal_site>.<domain_name>
            ServerAlias    www.<your_drupal_site>.<domain_name>
            <Directory "/var/www//<your_drupal_site>">
        #        Options -FollowSymLinks -SymLinksIfOwnerMatch
                AllowOverride All
        #        Order allow,deny
        #        allow from all
            </Directory>
        </VirtualHost>

<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Activate</div **********************************>

-   Make a soft link of that file in  `/etc/apache2/sites-enabled` (IfT: sh ../_01.sh).

-   Enable the <port>  in `/etc/apache2/ports.conf` with an additional line:

        Listen <port>

-   Restart the Apache (`/etc/init.d/apache2 restart`)

<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, URL</div **********************************>


3.3.  URL for the new site
--------------------------

The site can be accessed in the browser with two different URLs:

-   `http://<subdomain>.<domain_name>`

    This only works, if the host is connected to `<domain_name>`.

-   `http://<host_ip_number>:<port>`

    This works only, if the <port> is unique at the host and is enabled
    in `/etc/apache2/ports.conf` with a `Listen <port>` line.

So be aware to enable at least one method!


<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Redirect</div **********************************>


3.4.  Make an internal site accessible from internet
----------------------------------------------------

To give world-wide access to a site on a server in the intranet:


-   On the `<www_server>` (which is connectible from the internet) create an include
    file `<subdomain>' in `/etc/apache2/sites-available` with the content:

        <VirtualHost *:<www_port>>
           RewriteEngine  On
           RewriteRule    "^/(.+)"  "http://<domain_name>:<port>/$1"
           ServerName     <domain_name>
           ServerAlias    www.<domain_name>
        </VirtualHost>

    and link that file to `/etc/apache2/sites-enables`. `<www_port>` can be any port.

-   If the domain with `domain_name>` is connected to the `<www_host>`, there is no
    reason to put the `<www_port>` other than 80.

<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Redirect</div **********************************>


-   Redirect the port:

        redir --lport=<port> --cport=<port_remote> --caddr=<intern_host>  &

    where `<intern_host>:<port_remote>` is the site's URL reachable from the intranet.


<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Database</div **********************************>


In one command:


    python3 -m iftlib.drupal.create_drupal_site



<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Database</div **********************************>


3.5.  Database for the new drupal site
--------------------------------------

The persistence engine in Drupal is an SQL database which has to be chosen during
the following configuration process. Later migration SQLite <-> MySQL is possible. 

-   SQLite (for the advantage of easily moving the drupal site)

-   MySQL (for the advantage of performance).

    In preparation create a database for the new drupal site:

        mysql -u root -p
        > create database <database_name>
        > create user <dbuser>
        > use <db>
        > grant all privileges on <db>.* to 
             .... '<db>.*'@'localhost' identified by `<password>`

    Notice `<database_name>`, `<user>` and `<password>`.


<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Configuration</div ********************************>


3.6.  Initial Configuration of the drupal site
----------------------------------------------

-   Start your site for the initial configuration with:

        http://<url>

-   Later fittings can be done in `<your_drupal_site>/site/default/settings.php`

-   If there are server errors, look at /var/log/apache2/error.log.

-   Choose standard values.

-    Later migration from SQLite to MySQL (back and forth) is possible. 

At the end of configuration:
    chmod a-w /var/www/<your_drupal_site>/sites/default/settings.php`


<p class="break"/><div class="header">Drupal -- Drupal Site Set Up, Configuration</div ********************************>



3.7.  Installation of themes
----------------------------

Themes can be installed with drush. At least there should be installed:

-   A Standard simple theme, easy to use:

        drush835 en --yes whitejazz

-   The Drupal basic bootstrap theme

        drush835 en --yes bootstrap

-   The best configurable theme (recommmended!):

        drush835 dl --yes adaptivetheme
        drush835 en --yes at_tools
        drush835 en --yes at_core              
        drush835 en --yes at_theme_generator   

-   Other theme of your choice.

<p class="break"/><div class="header">Drupal -- Site customization</div ********************************>

3.8.  Google analytics and multilingual support
-----------------------------------------------

        drush835 en --yes googleanalyticsmaster


        drush835 en --yes locale
        drush835 en --yes language
        drush835 en --yes content_translation             
        drush835 en --yes config_translation


<p class="break"/><div class="header">Drupal -- Site customization</div ********************************>


4.  Customize the Site
======================

Log in into your site as administrator:  `http://<url>/user`


4.1.  Choose a theme
--------------------

In the Administer-Menu -> Appearance (or: `<url>/admin/appearance`) you can choose your theme.


4.2.  Adaptive subthemes
------------------------

Also you can generate an Adaptive subtheme with the *AT Theme Generaotr*


<p class="break"/><div class="header">Drupal -- Responsive Design</div ********************************>


4.3.  Responsive Design and AT subtheme settings
------------------------------------------------

Responsive Site Design offers two styles depending on the width of the
device.

Example: Each Adaptive subtheme has Responsive Menues. Choose:

-   Mobile

-   Default style: Drop down

-   Responsive style: Slide down

The 'breakpoints' between different (menue) layouts are defined
in a kind of `...breakpoints.yml` file in the theme's directory
(see the folder `themes` in the site's directory.)

The other Adaptive theme settings also offer color basic settings
with the color module.


<p class="break"/><div class="header">Drupal -- More Customizing and Developing</div ************************>


4.4.  Custom CSS
----------------

To re-define styles for the theme, look for the file `custom.css` in the
theme's directory (`themes/<yopur_theme>`) and put all the info here.

Example (in the whitejazz theme):

    #page { background-color: yellow; }

sets the page's background to yellow.

For other themes the certain style settings have to be investigated.

PROTECT your custom.css of overwriting and backups!


4.5.  Developing themes
-----------------------

More sophisticated settings have to be programmed in the theme itself
(see the folder `themes` in the site's directory.)


<p class="break"/><div class="header">Drupal -- Multilingual support</div ************************>


5.   Multilingual support
=========================

tbd





<!--


-  Install packages (to be re-worked, list is from drupal 7):

   drush  --yes  pm-download  message message_notify insertFrame style_settings colors
   drush  --yes  pm-download  views entity entity_translation ctools variable menu_attributes
   drush  --yes  pm-download  block_class i18n job_scheduler feeds rules content_access content_menu
   drush  --yes  pm-download  jquery_update languageicons language_switcher libraries entityreference
   drush  --yes  pm-download  menu_block metatags_quick nice_menus webform profile2 variable_store
   drush  --yes  pm-download  views_bulk_operations views_slideshow admin_menu locale tmgmt
   drush  --yes  pm-download  features panels page_manager advanced_help entityreference_prepopulate
   drush  --yes  pm-download  strongarm token whitejazz bootstrap ckeditor imce
   (drush --yes  pm_download  mytinytodo imce_wysiwyg wysiwyg)  <-- obsolete modules

   drush --yes  pm-enable   ....     -> the packages above

   drush ckeditor-download


The installation can be executed automatically with the script  install_drupal.py
    (aehh ... wo ist das skript?)


2.4.  Make an internal site accessible from internet
----------------------------------------------------

To give world-wide access to a site on a server in the IfT intranet
(e.g. 10.5.5.1):


-   On the IfT server 10.1.1.1 (172.20.20.1, 85.214.156.58) create an include
    file `<subdomainin `/etc/apache2/sites-available` with the content:

        <VirtualHost *:80>
           RewriteEngine  On
           RewriteRule    "^/(.+)"  "http://<domain_name>:<port>/$1"
           ServerName     <domain_name
           ServerAlias    www.(include-file-name)
        </VirtualHost>

    and link that file
    to `/etc/apache2/sites-enables`,

and redirect the port:

redir --lport=(port) --cport=(port_remote) --caddr=10.5.5.1  &

where 10.5.5.1:(port_remote) is the site's URL reachable from the intranet.



2.5.  Database Configuration and Migration
------------------------------------------

This sectionb is optional and only necessary when database changes have to be done.


With the database migration module installed, configure your database settings
in the sites/default/settings.php as follows:
 e.g.:
  $databases = array (
    'default' => array (
      'default' =>
        array (
          'database' => 'sites/default/files/.ht.sqlite',
          'driver' => 'sqlite',
          'prefix' =>'',
        ),
    ),
    'alternative' => array (
      'default' =>
        array (
          'database' => 'db',
            'username' => 'dbu',
            'password' => 'dbp',
            'host' => 'localhost',
            'port' =>'',
            'driver' => 'mysql',
            'prefix' =>'',
          ),
      ),
  );

The 'default' database connection will be chosen as the current database
moving all data from the 'default' database connection to 'alternative' database
connection (as defined above) is enabled by drushs interface to the database migrator module:

drush dbtng-replicate default alternative

Be aware that the target database connection should point to an empty database!

Whilst the migrator module also has an interface inside its drupal module configuration site,
usage of such is discouraged, as it has led to errors in the past.

So in the same way you can switch to SQLite back.



3.  Configuring the site:
=========================


3.1.  Install themes
--------------------

General: Consider deleting caches if there are changes on the site.
IMPORTANT: While development, disable 'Aggregate CSS-Files'
(under Administration->Configuration->System->Performance)


Themes can be installed with drush. Install this two themes:

    drush dl whitejazz
    drush dl bootstrap
    drush dl adaptivetheme



3.2. CKEditor:
--------------
With standard installation, there is a Editor activated. Edit its facilites under:

/admin/config/content/formats/manage/basic_html



3.3.  Choosing WhiteJazz Theme
------------------------------

Choose the WhiteJazz-Theme and configure it:
NO Secondary and Footer menu
Put Primary Menu in Menu Bar (not in Primary Menu, otherwise the menu hierarchy is ignored!)
In Main Menu: Configure and set menu item levels (1 min, 3 max)
Be aware about the other configuration settings
In the 'Blocks settings: Put the User Menu to the Left Sidebar
                         Put the Main Menu to the Suckerfish Menu



3.4.  Enabling Clean URLs  (without ?q=):
-----------------------------------------

Activate the rewrite module in Apache:

a2enmod rewrite
server apache2 restart
Then in the drupal site choose in the admin mode:
Configuration -> Search and Metadata -> Clean URLs



3.5.  Enable Multilanguage Support
----------------------------------

Necessary Modules:
   Language Switcher
      provides a block with links which can be used for language switching
   Language Icons
      provides language icons for the language block
   Internationalization
      provides multilingual features for drupal
   Menu translation
      adds translation options for menus
   Multilingual content
      adds translation options for content which has multilanguage enabled in the content type settings
   Dependencies:
      String translation   - required by Menu translation
      Translation sets     - required by Menu translation

Necessary Configurations:

   Enable Multilanguage support for each content type which should be translatable
      http://template.web-klick.de/admin/structure/types/manage/page
      -> click on "Multilanguage settings"
      -> enable content type multilanguage support

   Change Language selection to "path prefix" and configure each custom prefix for the individual languages:
      http://template.web-klick.de/de/admin/config/regional/language/configure/url
      -> change to path prefix

      http://template.web-klick.de/de/admin/config/regional/language
      -> click on "edit" for the language to customize the path prefix
         -> enter the path prefix in "Path prefix language code" (e.g.: en for english, de for deutsch)

   Edit the menu translation option:
         http://template.web-klick.de/en/admin/structure/menu/manage/main-menu/edit
      -> change multilanguage option to "Translate and Localize"

Each page can now be specified for one of the enabled languages and will only show if the corresponding
language is enabled by using the language switcher (all content is visible in the content overview of the admin page)

Workflow:
   create a page in the default language
   edit the page and click on "translate"
   add the translation for the required language
   provide a menu link


4. Updating the sites
=====================

THIS IS OBSOLETE!


Can be done with the script clear.pl above the websites in the directory ../websites.

Update your sites via:

     perl _actualize.pl  <site1>   <site2>   ....

If you are root, you can actualize all of the sites by:

     sh _actualize.sh

For all maintenance use the tool  drush !


5. Extending Themes
===================

Install the adaptive theme (meta theme for creating themes):

    drush dl at_tools
    drush dl adaptivetheme

    drush en at_tools
    drush en at_core
    drush en at_theme_generator


After the adaptive theme and module have been enabled, you should see a new
theme called "AT Theme Generator".

 -  #### creating a new theme
     - Go to "appearance" and click on the "AT Theme Generator" link at the top to create a new adaptive theme
     - Choose a name and select all options (or less if you know what youre doing)
     - the new theme will be created and can then be enabled

 - #### cloning a theme
     - cloning an existing theme which was created by adaptive theme generator is
     is also possible via the theme settings. Just select "clone" and the theme
     which you want to clone. the theme "ift_base" has already been extended
     for more configuration options and should serve as the default cloning base

 - ### modifying an adaptive theme
    - most parts of the theme can simply be changed in the theme settings:
      - changing basic colors: only 4 areas enabled by default
      - chaning fonts: go to "fonts" and apply any font to any region
      - changing behavior of menu (drop down etc)
      - display settings (logo, user pictures in comments, etc)

 - ### modifying the available options on "colors" section in theme settings
    - the available options for "colors" in the theme section are determined by
      the color module. this works as follows:
       - colors which can be customized are defined in drupal_root/theme_name/color/color.inc
       - for any color defined here, the color modules performs a search and replace
         on the themes style.css given the default color and the color set in the theme settings
       - the modified style.css is copied to drupal_root/sites/default/files/css/
    - his means that, after changing something in style.css or color.inc, the theme settings
      in the color section need to be saved again, so this process is repeated and the style is update_shadow_pwd
    - caveat: the color module doesn't expect the color.inc to change after the theme
      has been installed. this means that the theme needs to be cloned to a new theme
      for the changes to take effect. use may use the adaptive theme generator for cloning




5.1.  Changing values via the administration mode:
--------------------------------------------------

It is possible to manipulate the added values in the style.css
via the administration mode in the browser. To enable this for
a variable, add a line in the .info-file of the theme:

settings[whitejazz_background] = '<newvalue>'

(in the example above).

Then the value in the styles.css will be overwritten by the <newvalue>
by default. This default value can be changed by adding
an appropriate entry in the  theme-settings.php .


IMPORTANT:
1. After changes in the style.css and the .info file is is necessary
   to clear the cache with:   drush cc all   to make the changes active.
2. Store copies from the originary style.css and the .info-file under:
   style.css.orig  resp.  <theme>.info.orig  resp.  theme-settings.php.orig
   to avoid that the changed files will be overwritten when an update runs.




8. Use of the sites
===================

8.1.  Multilingual support
--------------------------

Multilingual support is prepared for all sites that stem from
the drupal-ift-template because the multilingual modules
are inside it. To activate the multilingual ability, it
has to be activated in the Content type menu (-> 'Einfache Seite').
Choose: Multilingual support in 'Publishing options', then save (!),
('Anzeigeeinstellungen') and then in 'Multilingual settings' set:
'Set current language...'  and:  'Extended'.

8.2.  General Policies
----------------------

Each site has a main menu with sub-menues.
Each site only uses the Content type: 'Einfache Seite'.

Each site is reachable as admin with login:  ift /ift123
via the URL: <site-url>/user


8.3.  Creating/Editing Pages
----------------------------

To create a new page, go to: Content -> Add Content -> Einfache Seite
To edit a site, click 'Edit' at the page.

Choose the title of the new page identical to the URL alias
(see URL path settings below)
URL alias AND title: both is mandatory!
URL alias AND title: only use small letters and numbers (no spaces!)

Each page should be connected to a menue-point, which can be arbitrary.

Only use Text Format:  Full HTML .



Editor:
-------
Use the editor for editing the body.
Use tables and images, different fonts, types and colors.


Images:
-------
Upload Images in the CKEditor (or put them directly
in the site's directory under sites/all/files)
Perform a suitable directory/subdirectory structure for the images

In the image menue, resize the images to a proper size for the page,
then choose an image and insert it with 'Insert file'


Menue:
------
Reorganize the main menue via  Structure -> Menues -> Hauptmenu.
Shift the menue-points vertically for reorganizing their series,
OR vertically to declare menue-points as sub-menue-points.
Important: Choose 'Show as expanded' in each Menue entry
(click on 'edit' at the page Structure->Menues->Hauptmenu for that).


8.4.  Themes (to be reworked for Drupal 8)
------------------------------------------

Themes can be downloaded with drush.
For general use take  WhiteJazz,  Responsive Blog
and the Artisteer Themes.

   Procedure for editing drupal themes:
   8.4.1 Background Information:
   ---------------------------------------------------------------
      drupal theme is usually located at sites/all/default/themes/<theme_name>
      drupal is using a template system, the template files are located at <theme location>/templates

      important files and folders:
         <theme location>/template.php
            main entry point for the template, this is also where each custom css file
            will be loaded. (see "loading css files")
         <theme location>/styles.css
            default stylesheet files
         <theme location>/css/
            all css extensions

   8.4.2 Theme preperation:
   ---------------------------------------------------------------
      in order to avoid theme updates that might mess up the changes, the theme name can be
      changed by editing the <theme name>.info file.

   8.4.3 adding css files:
   ---------------------------------------------------------------
      new css files should be stored in <theme location>/css/[optional subfolder/]
      naming convention:
         subfolders are named by their location.
            e.g. "header", "content", "sidebars" etc.
         files are named, if possible, by their corresponding css class or region.
            e.g. "region-left-sidebar", "logo", "search" etc.

   8.4.4 loading css files:
   ---------------------------------------------------------------
      open the template.php and search for a line containing *.css.
      duplicate the entry and change the path to your new css file
      if this entry does not exist:
         add the following line inside the <theme name>_preprocess_html function
         drupal_add_css(path_to_theme() . '/css/[<css subfolder>/]<css file>');
      lower entries have higher precedence
      css changes can be removed by commenting their respective lines in the template.php file

   8.4.5 editing styles of the theme:
   ---------------------------------------------------------------
      identify id or class of the area that should incorporate the changes
      optional: try out the changes interactively by using chrome or firebug developer tools
      create a new css file if necessary and insert changes
      load the css file in the template.php

   8.4.6 css basics:
   ---------------------------------------------------------------
      /* Generally, the primary statement in CSS is very simple */
      selector { property: value; /* more properties...*/ }

      /* the selector is used to target an element on page.

      You can target all elments on the page! */
      * { color:red; }

      /*
      Given an element like this on the page:

      <div class='some-class class2' id='someId' attr='value' />
      */

      /* you can target it by its name */
      .some-class { }

      /*or by both classes! */
      .some-class.class2 { }

      /* or by its element name */
      div { }

      /* or its id */
      #someId { }

      /* or by the fact that it has an attribute! */
      [attr] { font-size:smaller; }

      credits: http://learnxinyminutes.com/


8.5.  Menues
------------

The Main menu can (should) be reorganised by clicking 'Structure -> Menus -> Hauptmenu'.
There you can drag and drop the menu issues. Don't forget to save the new configuration!


8.6.  Artisteer (to be re-visited)
----------------------------------

The Artisteer themes are stored in _artisteer together with their  artx-file's.
Only the zip-Files have to go to the sites. Unpacked, there is an new artx-file
which can be edited and in this way an Artisteer theme can be changed
in the site.

File name convention:

<arttheme>-7.x-n.m.artx   ->  the artx-theme stored in _artisteer

In Artisteer, export it to:

<arttheme>.zip,          then rename this file to:
<arttheme>-7.x-n.m.zip   ->  export it to the site and unpack it

In the site you have:

<arttheme>.artx

If you want, change this file via Artisteer and export it to
<arttheme>.zip    again, unpack it newly

If <artisteer>.artx is a new valid theme, copy this file
under the new name:

<artisteer_newtheme>-7.x-1.0.artx



8.8. Insert a file for download (Doc, pdf, ...)
-----------------------------------------------

If you want to insert a file for download you must open the Editor of the Basic Page
(click the Edit button on your page). Then choose a name (any word or text) for the
file and insert it at any position.
After that, mark the word or text you have inserted and click on the Link Symbol in the toolbar.
Click on browse Server and upload the file to the images folder. After that, choose and
insert the file. Finally click "ok" and save !


9.  Troubleshooting
---------------------------------------------
Password recovery

Generate login-link for login:
	drush uli admin
	this will create a login-link for the admin user, which can be used to change the password in the account settings

	the link is in the form of http://default/user/reset/3/1408549052/tpEOVkSDks0UwtVp0lg5V0lfqLpOe_0KEoHc7bFk4/login
	where http://default has to be replaced by the name of the actual website (ddienlin 20.08.2014)
Reset password
	drush upwd --password="givememypasswordback" admin
	this method is supposed to work aswell, but didn't work for me recently (ddienlin 20.08.2014)


10.  Synchronize User login to UNIX passwords
---------------------------------------------

Architecture overview:

The synchronization of the passwords between the Linux system and Drupal is handled by a daemon (pwd_sync.py),
which is able to check for validity of a specified user password and change the password of a user.

The communication between Drupal and pwd_sync.py is done by Gearman. Gearman is a job server where a client
(in this case Drupal) can connect to Gearman and send a job request (a job name which is a simple string and
a parameter which can be any data). The actual work is done by a worker (here pwd_sync.py) that registers to the
Gearman server and receives all job requests that match the given job name. A single worker is also able to
register for multiple jobs.

In order to work the Drupal installation has to be modified. The file "includes/password.inc" in Drupal has
a function "user_check_password" which is executed each time a user wants to login. At the beginning of the
function the following lines must be added:

$gmclient= new GearmanClient();
$gmclient->addServer();
$gmclient->setTimeout(1000);
$res = $gmclient->doHigh("check_shadow_pwd", $account->name.':'.$password);
if ($res=="true") return TRUE;
// else fallback to old system

These lines send a job request to the local Gearman daemon with the job name "check_shadow_pwd" and the user name
and the password seperated by a colon as the parameter. If a worker (pwd_sync.py) sends "true" (which is a string
in this case) as the result the user is logged into Drupal. Otherwise the logic "falls through" and returns the
usual result given by the Drupal system. The password sent to a worker is sent in plain text! However, as it is done
locally, it is not a security risk.

The second file to modify in Drupal is "modules/user/user.module". The function "user_save" is called whenever some
user data have changed. The following part of the function is executed, whenever the password for a user is changed:

if (!empty($edit['pass'])) {
      // Allow alternate password hashing schemes.
      require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
      $edit['pass'] = user_hash_password(trim($edit['pass']));
      // Abort if the hashing failed and returned FALSE.
      if (!$edit['pass']) {
        return FALSE;
      }

Therefore these lines have to be added after the above mentioned:

// Update pwd_sync_daemon
$gmclient= new GearmanClient();
$gmclient->addServer();
$gmclient->setTimeout(1000);
$gmclient->doHigh("update_shadow_pwd", $account->name.':'.$edit['pass']);

Like in "user_check_password" this will send a job request with the name "update_shadow_pwd" and the user name combined
with the password by a colon. This time, however, the password is a hash generated by the function "user_hash_password" in
"includes/password.inc". A precondition for this to work is that "user_hash_password" generates a password hash which is
compatible with the Linux crypt system (which it is in Drupal 7). The result of the job is ignored and the rest of the
code in "user_save" is not affected by these changes. Therefore password updates are propagated into the Linux system
as well as into the Drupal database.

On the worker side pwd_sync.py simply registers two methods for "update_shadow_pwd" and "check_shadow_pwd" at the
Gearman daemon and receives henceforth all job requests for these two methods. "update_shadow_pwd" is a simple system call
to "usermod", which is a Linux executable. "check_shadow_pwd" is more complicated as it requires the parsing of
"/etc/shadow". As the access to this file is restricted to root, pwd_sync.py must be run as root. "check_shadow_pwd" scans
the shadow file each time and if the user name matches it uses the crypt module of Python to check the given password hash.
It also has a MIN_USER_ID constant which must be set to the lowest user id that is allowed to login into Drupal. This
protects the system users (daemon, www-data, nobody, etc...) from logging in if the same user name happens to be created
in Drupal. The actual logic of password checking and changing is seperated into a second Python module named "shadow.py".


Installation:

This setup requires Python 2.x, Gearman and python-pip (which is a package manager for Python modules).
Python 2.x and python-pip can be installed via "apt-get", Gearman has to be compiled from source,
however. There is a package called "gearman-job-server" in the Debian repository, however, it is a
Perl implementation of Gearman which happens not to work with the Python bindings. The official Gearman
website is http://www.gearman.org, the source code of the C implementation is on https://launchpad.net/gearmand
The installation is a simple "./configure", "make", "make install".
To install the Python bindings, run "easy_install gearman" as root.


Usage:

After modifying the Drupal installation as mentioned above the Gearman daemon must be running
("/etc/init.d/gearman-server start") and "pwd_sync.py" must be started by root
("python2.6 pwd_sync.py &") in background. Afterwards the "usage" is done by Drupal:
Loggin in and changing password is done the same way as it is without the pwd_sync daemon.




19.  Hints
----------

Language Switcher block: Choose <none> for the title of this block
for not to see the block title 'Languages'. Change the mode for the
language text to 'only icon' in the
Administration -> Regional and Language -> Language -> Language Switcher -> Icons.

The Search has to be permitted for certain users in the Permission page.

Migration of Database is possible with the DBNTG Migrator Module and
can be managed by Administration -> Structure -> Migrator
resp.  drush dbtng-replicate <source> <dest>  (see the README in the dbtng_migrator module)

Toggle Maintenance Mode: Click on Configuration, then you find
the maintenance mode. Do not forget to clear all caches after toggling!
Go online manually in the database:
update variable set 'i:0' where name='maintenance_mode'

Double Admin menu: Deactivate the Toolbar module.



-   Second method (Does not seem to work):


a)  drush can only run with php > 5.6. To get this on Ubuntu 14.04:

    add-apt-repository ppa:ondrej/php5
    apt-get update
    #    apt-get install python-software-properties
    #    apt-get update
    apt-get install php5.6

b)  curl -sS http://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer

c)  Introduce in /etc/profile:

    export PATH="$HOME/.composer/vendor/bin:$PATH"

    After that, get a new console so that the new PATH is loaded.

d)  composer global require consolidation/robo:dev-master
    composer global require symfony/console:dev-master
    composer global require symfony/console:2.7.x-dev
    composer global require symfony/event-dispatcher:2.7.x-dev
    composer global require drush/drush:dev-master


    Does not seem to work.


-->



<p class="break"/><div class="header">IfT Informatik GmbH Fürth</div> <!-- ********************************** -->

<br/>
<br/>
<br/>

<CENTER>
Thank you!
==========
</CENTER>

<br/>

<p style="page-break-before: always;"></p></br>
<img src="ift_presentation_footer2.svg" width="100%"/>




bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net