Chinaunix首页 | 论坛 | 博客
  • 博客访问: 203332
  • 博文数量: 54
  • 博客积分: 2056
  • 博客等级: 大尉
  • 技术积分: 568
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-25 12:07
文章分类

全部博文(54)

文章存档

2014年(1)

2013年(1)

2012年(1)

2011年(2)

2010年(1)

2009年(11)

2008年(28)

2007年(9)

我的朋友

分类:

2008-05-16 17:18:05

 

 Creating New Users 

You create new users with the page create.htm . A check performed at page initialization ensures that this page can only be called by an administrator.

The authorization check performed at function call already ensures that no unauthorized user can create a new Internet User, but it makes sense that unauthorized users should not even be able to display the Create page.

You enter the required user data for a new user on this page.

The figure below displays the screen on which you create a new Internet user:

In OnInputProcessing of the page, the function module SUSR_USER_INTERNET_CREATE is called. This function module creates the new user. The INT_USER serves as a reference user here. The new Internet user has the same authorizations as the reference user. The user name queried is used as a alias, the function module generates a SU01 user name.

Page Attributes

Attribute Name

Auto

Typing Type

Reference Type

Description

err_msg

 

TYPE

STRING

Error message

Layout

<%@ page language="abap" %>

Create new user
































User Name
Password
verify Pwd
First Name
Last Name
Email


Event Handler OnInputProcessing

data: newuser type bapialias,
pwd1 type bapipwd,
pwd2 type bapipwd,
refuser type bapibname,
address type bapiaddr3,
newuserid type bapibname.

data: return type table of bapiret2,
wa_return type bapiret2.

newuser = request->get_form_field( 'newuser' ).

pwd1 = request->get_form_field( 'pwd1' ).

pwd2 = request->get_form_field( 'pwd2' ).

address-firstname = request->get_form_field( 'firstname' ).

address-lastname = request->get_form_field( 'lastname' ).address-e_mail = request->get_form_field( 'email' ).

refuser = 'INT_USER'.

CALL FUNCTION 'SUSR_USER_INTERNET_CREATE'
EXPORTING
ALIAS = newuser
PASSWORD = pwd1
PASSWORD2 = pwd2
ADDRESS = address
REF_USER = refuser
IMPORTING
GENERATED_BNAME = newuserid
TABLES
RETURN = return
.

loop at return into wa_return.
concatenate err_msg '
' wa_return-message into err_msg.
endloop.

You can of course use multiple reference users for different purposes. This enables you to create scenarios where selected Internet users have authorization to create other Internet users.

It is also conceivable that you would have applications where new users may create their own users and register themselves. In this case, the guest user, used to display the public pages, would have to have authorization to create Internet users.

 

阅读(1131) | 评论(0) | 转发(0) |
0

上一篇:ABAP and Javascript

下一篇:HTMLB - BUTTON

给主人留下些什么吧!~~