-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuser.php
94 lines (71 loc) · 1.75 KB
/
user.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/*******************************************************************************
*
* @author : Dominik Bonsch <[email protected]>
* @date :
* @copyright : Webfrap Developer Network <[email protected]>
* @project : Webfrap Web Frame Application
* @projectUrl : http://webfrap.net
*
* @licence : BSD License see: LICENCE/BSD Licence.txt
*
* @version: @package_version@ Revision: @package_revision@
*
* Changes:
*
*******************************************************************************/
// die Basis Logik einbinden
include 'wbf/core.php';
include GAIA_PATH.'core/user/UserContainer.php';
$action = Request::arg( 'action' );
switch ( $action )
{
case 'import_citems' :
{
$dbKey = Request::arg( 'db' );
$file = Request::arg( 'file' );
$start = Request::arg( 'start', 1 );
$types = Request::arg( 'types' );
if( !$types )
{
$types = array( '2' => 'mail' );
}
else
{
$tmp = explode( ',' , $types);
$types = array();
foreach( $tmp as $tNode )
{
$t2 = explode( ':', $tNode );
$types[$t2[0]] = $t2[1];
}
}
if( !Fs::exists($file) )
{
Console::outln( "The given File: {$file} not exists" );
exit(1);
}
User::importContactItems( $file, $types, $setupDb, $key );
break;
}
case 'add' :
{
$dbKey = Request::arg( 'db' );
$data = new UserContainer();
$data->read();
User::addUser( $data, $setupDb, $dbKey );
break;
}
case 'help' :
{
$help = <<<HELP
HELP;
Console::out( $help );
break;
}
default:
{
///TODO fehlermeldung verbessern
Console::outln( "Invalid Parameter" );
}
}