Cheetah
profile_response.php
Go to the documentation of this file.
1 <?php
2 
8 if ($_GET['orca_integration'] && preg_match('/^[0-9a-z]+$/', $_GET['orca_integration'])) {
9  define('CH_ORCA_INTEGRATION', $_GET['orca_integration']);
10 } else {
11  define('CH_ORCA_INTEGRATION', 'cheetah');
12 }
13 
14 $aPathInfo = pathinfo(__FILE__);
15 require_once( $aPathInfo['dirname'] . '/inc/header.inc.php' );
16 if (!class_exists('Thing'))
17  require_once( $GLOBALS['gConf']['dir']['classes'] . 'Thing.php' );
18 if (!class_exists('ThingPage'))
19  require_once( $GLOBALS['gConf']['dir']['classes'] . 'ThingPage.php' );
20 if (!class_exists('Mistake'))
21  require_once( $GLOBALS['gConf']['dir']['classes'] . 'Mistake.php' );
22 if (!class_exists('ChXslTransform'))
23  require_once( $GLOBALS['gConf']['dir']['classes'] . 'ChXslTransform.php' );
24 if (!class_exists('ChDb'))
25  require_once( $GLOBALS['gConf']['dir']['classes'] . 'ChDb.php' );
26 if (!class_exists('DbForum'))
27  require_once( $GLOBALS['gConf']['dir']['classes'] . 'DbForum.php' );
28 
30 {
31  function response($oAlert)
32  {
33  global $gConf;
34 
35  $iProfileId = $oAlert->iObject;
36 
37  if (!$iProfileId || $oAlert->sUnit != 'profile' || ('delete' != $oAlert->sAction && 'edit' != $oAlert->sAction))
38  return;
39 
40  $sUsername = ('delete' == $oAlert->sAction ? $oAlert->aExtras['profile_info']['NickName'] : getUsername($iProfileId));
41 
42  if ('edit' == $oAlert->sAction && $oAlert->aExtras['OldProfileInfo']['NickName'] == $sUsername)
43  return;
44 
45  $oDb = new DbForum ();
46 
47  if (isset($oAlert->aExtras['delete_spammer']) && $oAlert->aExtras['delete_spammer']) {
48  $oDb->deleteUser($sUsername);
49  } else {
50  $sOldUsername = ('delete' == $oAlert->sAction ? $sUsername : $oAlert->aExtras['OldProfileInfo']['NickName']);
51  $sNewUsername = ('delete' == $oAlert->sAction ? $gConf['anonymous'] : $sUsername);
52  $oDb->renameUser($sOldUsername, $sNewUsername);
53  }
54  }
55 
56 }
ChWsbAlertsResponse
Definition: ChWsbAlerts.php:127
$oAlert
$oAlert
Definition: embed.php:15
php
DbForum
Definition: DbForum.php:35
ChForumProfileResponse
Definition: profile_response.php:30
$_GET
$_GET['debug']
Definition: index.php:67
$oDb
global $oDb
Definition: db.inc.php:39
getUsername
getUsername( $ID='')
Definition: profiles.inc.php:443
$aPathInfo
$aPathInfo
Definition: profile_response.php:14
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
ChForumProfileResponse\response
response($oAlert)
Definition: profile_response.php:31
$gConf
global $gConf
Definition: header.inc.php:8
$iProfileId
if( $sMembersList) $iProfileId
Definition: communicator.php:29
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10