OpenID Login with google and PHP

Example implementation how to use google OpenID for a login to a Website.
http://woppr.de/openid/google.php

Prerequisite:
LightOpenID PHP 5 library for openid authentication (openid.php)

Google, completely ignores optional parameters, and for the required ones, it supports, according to it’s website:

  • namePerson/first (first name)
  • namePerson/last (last name)
  • contact/country/home
  • contact/email
  • pref/language

Code:

 
<?php
# Logging in with Google accounts requires setting special identity, so this example shows how to do it.
require 'openid.php';
try {
    $openid = new LightOpenID('woppr.de');
    if(!$openid->mode) {
        if(isset($_GET['login'])) {
            $openid->identity = 'https://www.google.com/accounts/o8/id';
 
            $openid->required = array('namePerson/first', 'namePerson/last', 'contact/email');
 
            header('Location: ' . $openid->authUrl());
        }
?>
<form action="?login" method="post">
    <button>Login with Google</button>
</form>
<?php
    } elseif($openid->mode == 'cancel') {
        echo 'User has canceled authentication!';
    } else {
        if($openid->validate()) {
		$returnVariables = $openid->getAttributes();
		echo 'User ' . $openid->identity . ' has logged in with this email address ' . $returnVariables['contact/email'] . ' Name: ' . $returnVariables['namePerson/first'] . ' ' . $returnVariables['namePerson/last'];
		} else {
		echo 'User has not logged in.';
		}
 
    }
} catch(ErrorException $e) {
    echo $e->getMessage();
}

Quote Steve Jobs

the-only-way-to-do-great-work-is-to-love-what-you-do-2

Shortcuts Mac

ScreenShot

ShortCut Aktion
Cmd + Shift + 3 Speichert gesamten Bildschirm als Datei.
Cmd + Ctrl + Shift + 3 Speichert gesamten Bildschirm in der Zwischenablage.
Cmd + Shift + 4 Speichert einen ausgewählten Bereich als Datei.
Cmd + Ctrl + Shift + 4 Speichert einen ausgewählten Bereich in der Zwischenablage.
Cmd + Shift + 4, danach Leertaste Speichert ein gewähltes Element/Fenster als Datei.
Cmd + Ctrl + Shift + 4, danach Leertaste Speichert ein gewähltes Element/Fenster in der Zwischenablage.

 

http://www.maceinsteiger.de/how-to/screenshot-unter-mac-os/

Wie können Bilder mit dem Mac verkleinert werden?

Hier eine kurze Anleitung wie Bilder mit dem Mac verkleinert werden können. Es wird hierzu kein zusätzliches Programm benötigt, sondern lediglich das Programm Vorschau (Preview), das mit Mac OS X ausgeliefert wird.

1. Zunächst das Programm Vorschau über /Programme/Vorschau starten oder ein Bild mit Vorschau öffnen.

2. Über die Miniaturansicht können auch mehrere Bilder ausgewählt werden.

3. Über Werkzeuge –> Größenkorrektur die Größe der Bilder auf die gewünschte Größe ändern.

Vorschau Bildgröße ändern

Vorschau Bildgröße ändern

Vorschau Bildgröße ändern

Vorschau Bildgröße ändern

How to create a Message in ABAP

This example shows how to create a  Message in SAP-ABAP.

First example shows the “simple” way without a dedicated message class.

The second example shows how to create a Message with a Message Class.

To access the message class double-click on the class name or use Transaction Code SE91:

Code:

DATA:   REPORT  ZTESTMS_MESSAGE.
 
"Simple message without a message class
MESSAGE 'Simple Message' TYPE 'I'.
 
"Message with a message class 'ZMS_messagtest'
MESSAGE i000(ZMS_messagetest).
MESSAGE i999(ZMS_messagetest) WITH 'text123'.

Create range for selecting values in abap

DATA:   r_values TYPE RANGE OF ztest123-value,
        r_values_line LIKE LINE OF r_values.
 
    r_values_line-SIGN = 'I'.  "I = include, E = exclude
    r_values_line-OPTION = 'EQ'.   "EQ, BT, NE ....
    r_values_line-LOW = '123'.  
    r_values_line-HIGH = '124'.
    append r_values_line to r_values.

 http://www.sapdev.co.uk/tips/tips_range.htm

Execute ABAP code only for a specific user

REPORT  ztest123_codeforuser.
 
IF sy-uname = 'USER123'.
 
  WRITE: / 'Code for specific user !!! '.
 
ENDIF.

Catch divide by zero exception in abap

REPORT  zmstest_divide_zero_exc.
 
START-OF-SELECTION.
 
  DATA : num TYPE i VALUE 5 .
 
  TRY.
      num = num / 0 .
    CATCH cx_sy_zerodivide .
      WRITE:/5 'Division by 0 caught' .
 
  ENDTRY.

Find Badis for a Transaction

With the following Steps Badi’s and User Exits can be found:

For Example use Transaction VA01.

  • Use SE93 and enter VA01 click display, to get the package “VA”.
  • Use SE84 > Enhancements >Business Add-ins >Definitons >Package as VA >F8

You will get all BADI’s related to the selected transaction

see also: <http://scn.sap.com/thread/1364289>

 

Create Implicit Enhancement in SAP

  • Search programm you want to enhance.
    e.g. Program “SAPMV50A”
  • Select a specific form in a subroutine
    e.g. /SPE/INSERT_EKBE_POD
  • Goto “Edit / Enhancement Operations / Show Implicit Enhancement Options”
    “Emphasizes” show the places of possible implicit enhancements

  • Select a specific place for the enhancement and click “Enhance (Shift+F4)”
  • Goto “Edit / Enhancement Operations / Create Implementation”

  • Enhancement is added in coding at the selected place. Custom Coding can be added here