mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
#310 change to url as the key
This commit is contained in:
parent
127d338119
commit
7ae0698a44
|
@ -311,8 +311,8 @@ CLASS lcl_git_transport IMPLEMENTATION.
|
||||||
lv_user TYPE string,
|
lv_user TYPE string,
|
||||||
lv_pass TYPE string.
|
lv_pass TYPE string.
|
||||||
|
|
||||||
* lv_default_user = lcl_app=>user( )->get_repo_username( iv_key = ).
|
lv_default_user = lcl_app=>user( )->get_repo_username( iv_url = iv_url ).
|
||||||
* lv_user = lv_default_user.
|
lv_user = lv_default_user.
|
||||||
|
|
||||||
lcl_password_dialog=>popup(
|
lcl_password_dialog=>popup(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
|
@ -326,7 +326,7 @@ CLASS lcl_git_transport IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF lv_user <> lv_default_user.
|
IF lv_user <> lv_default_user.
|
||||||
* lcl_app=>user( )->get_repo_username( iv_key = iv_username = lv_user ).
|
lcl_app=>user( )->set_repo_username( iv_url = iv_url iv_username = lv_user ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ii_client->authenticate(
|
ii_client->authenticate(
|
||||||
|
|
|
@ -90,12 +90,12 @@ CLASS lcl_gui_page_commit IMPLEMENTATION.
|
||||||
lo_user = lcl_app=>user( ).
|
lo_user = lcl_app=>user( ).
|
||||||
lv_key = mo_repo->get_key( ).
|
lv_key = mo_repo->get_key( ).
|
||||||
|
|
||||||
lv_user = lo_user->get_repo_username( lv_key ).
|
lv_user = lo_user->get_repo_username( mo_repo->get_url( ) ).
|
||||||
IF lv_user IS INITIAL.
|
IF lv_user IS INITIAL.
|
||||||
lv_user = lo_user->get_username( ).
|
lv_user = lo_user->get_username( ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
lv_email = lo_user->get_repo_email( lv_key ).
|
lv_email = lo_user->get_repo_email( mo_repo->get_url( ) ).
|
||||||
IF lv_email IS INITIAL.
|
IF lv_email IS INITIAL.
|
||||||
lv_email = lo_user->get_email( ).
|
lv_email = lo_user->get_email( ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -253,8 +253,8 @@ CLASS lcl_gui_page_commit IMPLEMENTATION.
|
||||||
ls_fields = lcl_html_action_utils=>parse_commit_request( it_postdata ).
|
ls_fields = lcl_html_action_utils=>parse_commit_request( it_postdata ).
|
||||||
|
|
||||||
lo_user = lcl_app=>user( ).
|
lo_user = lcl_app=>user( ).
|
||||||
lo_user->set_repo_username( iv_key = mo_repo->get_key( ) iv_username = ls_fields-username ).
|
lo_user->set_repo_username( iv_url = mo_repo->get_url( ) iv_username = ls_fields-username ).
|
||||||
lo_user->set_repo_email( iv_key = mo_repo->get_key( ) iv_email = ls_fields-email ).
|
lo_user->set_repo_email( iv_url = mo_repo->get_url( ) iv_email = ls_fields-email ).
|
||||||
|
|
||||||
IF ls_fields-username IS INITIAL.
|
IF ls_fields-username IS INITIAL.
|
||||||
lcx_exception=>raise( 'empty username' ).
|
lcx_exception=>raise( 'empty username' ).
|
||||||
|
|
|
@ -100,6 +100,10 @@ CLASS lcl_password_dialog IMPLEMENTATION.
|
||||||
EXPORTING p_status = sy-pfkey
|
EXPORTING p_status = sy-pfkey
|
||||||
TABLES p_exclude = lt_ucomm.
|
TABLES p_exclude = lt_ucomm.
|
||||||
|
|
||||||
|
IF p_user IS NOT INITIAL.
|
||||||
|
SET CURSOR FIELD 'P_PASS'.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
ENDMETHOD. "on_screen_output
|
ENDMETHOD. "on_screen_output
|
||||||
|
|
||||||
METHOD on_screen_event.
|
METHOD on_screen_event.
|
||||||
|
|
|
@ -707,22 +707,22 @@ CLASS lcl_persistence_user DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS set_repo_username
|
METHODS set_repo_username
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
iv_username TYPE string
|
iv_username TYPE string
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS get_repo_username
|
METHODS get_repo_username
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
RETURNING VALUE(rv_username) TYPE string
|
RETURNING VALUE(rv_username) TYPE string
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS set_repo_email
|
METHODS set_repo_email
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
iv_email TYPE string
|
iv_email TYPE string
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS get_repo_email
|
METHODS get_repo_email
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
RETURNING VALUE(rv_email) TYPE string
|
RETURNING VALUE(rv_email) TYPE string
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ CLASS lcl_persistence_user DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
|
||||||
WITH DEFAULT KEY.
|
WITH DEFAULT KEY.
|
||||||
|
|
||||||
TYPES: BEGIN OF ty_repo_config,
|
TYPES: BEGIN OF ty_repo_config,
|
||||||
key TYPE lcl_persistence_repo=>ty_repo-key,
|
url TYPE lcl_persistence_repo=>ty_repo-url,
|
||||||
username TYPE string,
|
username TYPE string,
|
||||||
email TYPE string,
|
email TYPE string,
|
||||||
END OF ty_repo_config.
|
END OF ty_repo_config.
|
||||||
|
@ -771,12 +771,12 @@ CLASS lcl_persistence_user DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS read_repo_config
|
METHODS read_repo_config
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
RETURNING VALUE(rs_repo_config) TYPE ty_repo_config
|
RETURNING VALUE(rs_repo_config) TYPE ty_repo_config
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
METHODS update_repo_config
|
METHODS update_repo_config
|
||||||
IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key
|
IMPORTING iv_url TYPE lcl_persistence_repo=>ty_repo-url
|
||||||
is_repo_config TYPE ty_repo_config
|
is_repo_config TYPE ty_repo_config
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
|
@ -1098,25 +1098,29 @@ CLASS lcl_persistence_user IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD read_repo_config.
|
METHOD read_repo_config.
|
||||||
DATA lt_repo_config TYPE ty_repo_config_tt.
|
DATA: lt_repo_config TYPE ty_repo_config_tt,
|
||||||
|
lv_key TYPE string.
|
||||||
|
|
||||||
|
lv_key = to_lower( iv_url ).
|
||||||
lt_repo_config = read( )-repo_config.
|
lt_repo_config = read( )-repo_config.
|
||||||
READ TABLE lt_repo_config INTO rs_repo_config WITH KEY key = iv_key.
|
READ TABLE lt_repo_config INTO rs_repo_config WITH KEY url = lv_key.
|
||||||
|
|
||||||
ENDMETHOD. "read_repo_config
|
ENDMETHOD. "read_repo_config
|
||||||
|
|
||||||
METHOD update_repo_config.
|
METHOD update_repo_config.
|
||||||
DATA ls_user TYPE ty_user.
|
DATA: ls_user TYPE ty_user,
|
||||||
|
lv_key TYPE string.
|
||||||
FIELD-SYMBOLS <repo_config> TYPE ty_repo_config.
|
FIELD-SYMBOLS <repo_config> TYPE ty_repo_config.
|
||||||
|
|
||||||
ls_user = read( ).
|
ls_user = read( ).
|
||||||
|
lv_key = to_lower( iv_url ).
|
||||||
|
|
||||||
READ TABLE ls_user-repo_config ASSIGNING <repo_config> WITH KEY key = iv_key.
|
READ TABLE ls_user-repo_config ASSIGNING <repo_config> WITH KEY url = lv_key.
|
||||||
IF sy-subrc IS NOT INITIAL.
|
IF sy-subrc IS NOT INITIAL.
|
||||||
APPEND INITIAL LINE TO ls_user-repo_config ASSIGNING <repo_config>.
|
APPEND INITIAL LINE TO ls_user-repo_config ASSIGNING <repo_config>.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
<repo_config> = is_repo_config.
|
<repo_config> = is_repo_config.
|
||||||
<repo_config>-key = iv_key.
|
<repo_config>-url = lv_key.
|
||||||
|
|
||||||
update( ls_user ).
|
update( ls_user ).
|
||||||
|
|
||||||
|
@ -1126,15 +1130,15 @@ CLASS lcl_persistence_user IMPLEMENTATION.
|
||||||
|
|
||||||
DATA: ls_repo_config TYPE ty_repo_config.
|
DATA: ls_repo_config TYPE ty_repo_config.
|
||||||
|
|
||||||
ls_repo_config = read_repo_config( iv_key ).
|
ls_repo_config = read_repo_config( iv_url ).
|
||||||
ls_repo_config-username = iv_username.
|
ls_repo_config-username = iv_username.
|
||||||
update_repo_config( iv_key = iv_key is_repo_config = ls_repo_config ).
|
update_repo_config( iv_url = iv_url is_repo_config = ls_repo_config ).
|
||||||
|
|
||||||
ENDMETHOD. "set_repo_username
|
ENDMETHOD. "set_repo_username
|
||||||
|
|
||||||
METHOD get_repo_username.
|
METHOD get_repo_username.
|
||||||
|
|
||||||
rv_username = read_repo_config( iv_key )-username.
|
rv_username = read_repo_config( iv_url )-username.
|
||||||
|
|
||||||
ENDMETHOD. "get_repo_username
|
ENDMETHOD. "get_repo_username
|
||||||
|
|
||||||
|
@ -1142,15 +1146,15 @@ CLASS lcl_persistence_user IMPLEMENTATION.
|
||||||
|
|
||||||
DATA: ls_repo_config TYPE ty_repo_config.
|
DATA: ls_repo_config TYPE ty_repo_config.
|
||||||
|
|
||||||
ls_repo_config = read_repo_config( iv_key ).
|
ls_repo_config = read_repo_config( iv_url ).
|
||||||
ls_repo_config-email = iv_email.
|
ls_repo_config-email = iv_email.
|
||||||
update_repo_config( iv_key = iv_key is_repo_config = ls_repo_config ).
|
update_repo_config( iv_url = iv_url is_repo_config = ls_repo_config ).
|
||||||
|
|
||||||
ENDMETHOD. "set_repo_email
|
ENDMETHOD. "set_repo_email
|
||||||
|
|
||||||
METHOD get_repo_email.
|
METHOD get_repo_email.
|
||||||
|
|
||||||
rv_email = read_repo_config( iv_key )-email.
|
rv_email = read_repo_config( iv_url )-email.
|
||||||
|
|
||||||
ENDMETHOD. "get_repo_email
|
ENDMETHOD. "get_repo_email
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user