INSERT INTO `Modules` VALUES ('', 'phpmc', 'global $mods;\r\n\r\n/**\r\n* ''ModuleDirectory''\r\n* Specifies name of directory, where chat is located\r\n* (string)\r\n*/\r\n\r\n$mods[''phpmc''][''ModuleDirectory''] = ''chat/'';', '/**\r\n* FuncUpdate procedure for phpMyChat\r\n* \r\n* @param string $UserIdentifier member ID or admin name (depend on $IsAdmin parameter)\r\n* \r\n* @param boolean $IsAdmin Defines whether user is a simple member or admin\r\n*/\r\n\r\nglobal $dir;\r\nglobal $mods;\r\nglobal $site;\r\nglobal $PHPBIN;\r\nglobal $prof; // If prof.inc.php was included already\r\n\r\nrequire_once($dir[''inc''].''prof.inc.php''); // To retreive country name\r\n\r\n$commandLineArgs = new CCommandLineArgs;\r\n\r\n$commandLineArgs->AddArgument(''update''); //Action\r\n\r\nif ($IsAdmin)\r\n{ \r\n // $UserIdentifier is interpreted as an admin name\r\n $adminInfo = db_arr("SELECT `Name`,\r\n `Password`\r\n FROM Admins\r\n WHERE `Name` = ''".$UserIdentifier."''");\r\n\r\n if (! $adminInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown admin ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($adminInfo[''Name'']);\r\n $commandLineArgs->AddArgument($adminInfo[''Password'']);\r\n \r\n $commandLineArgs->AddArgument(_t(''_Dolphin Administrator'')); // Real name\r\n $commandLineArgs->AddArgument(''''); // Country\r\n $commandLineArgs->AddArgument($site[''url'']); // URL (site address)\r\n $commandLineArgs->AddArgument($site[''email'']); // E-mail\r\n $commandLineArgs->AddArgument(1); // Show email\r\n $commandLineArgs->AddArgument(2); // Sex (undefined)\r\n}\r\nelse \r\n{\r\n // $UserIdentifier is interpreted as a profile ID\r\n $UserIdentifier = (int)$UserIdentifier;\r\n \r\n $userInfo = db_arr("SELECT `NickName`, \r\n `Password`, \r\n `Email`, \r\n `RealName`,\r\n `Country`,\r\n `Sex` \r\n FROM `Profiles`\r\n WHERE `ID` = {$UserIdentifier}");\r\n\r\n if (! $userInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown user ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($userInfo[''NickName'']);\r\n $commandLineArgs->AddArgument($userInfo[''Password'']);\r\n $commandLineArgs->AddArgument($userInfo[''RealName'']); \r\n $commandLineArgs->AddArgument($prof[''countries''][$userInfo[''Country'']]);\r\n $commandLineArgs->AddArgument($site[''url''].''profile.cmd.php?ID=''.$UserIdentifier); // set user URL as path of profile view page\r\n $commandLineArgs->AddArgument($userInfo[''Email'']);\r\n $commandLineArgs->AddArgument(! (bool)getParam(''anon_mode'')); // set ''Show email'' against of anonymouse mode\r\n $commandLineArgs->AddArgument($userInfo[''Sex'']); \r\n}\r\n\r\n$commandLineArgs->AddArgument((int)$IsAdmin);\r\n\r\nif (chdir($dir[''root''] . $mods[''phpmc''][''ChatDirectory'']))\r\n{\r\n $scriptReturnValue = ''value_was_not_set'';\r\n exec("{$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine(), $scriptOutput, $scriptReturnValue);\r\n if ($scriptReturnValue !== 0)\r\n {\r\n echo "phpmc_register.cmd.php output:
\\n";\r\n foreach ($scriptOutput as $outputLine)\r\n {\r\n echo $outputLine.''
\\n'';\r\n }\r\n echo ''------------------------------------------
'';\r\n modules_err("FuncUpdate(): exec({$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine().") returned ".$scriptReturnValue);\r\n } \r\n}\r\nelse \r\n{\r\n modules_err("FuncUpdate(): chdir({$dir[''root'']}{$mods[''phpmc''][''ChatDirectory'']} returned false");\r\n}', '/**\r\n* FuncDel procedure for phpMyChat\r\n* \r\n* @param string $UserIdentifier member ID or admin name (depend on $IsAdmin parameter)\r\n* \r\n* @param boolean $IsAdmin Defines whether user is a simple member or admin\r\n*/\r\n\r\nglobal $dir;\r\nglobal $mods;\r\nglobal $site;\r\nglobal $PHPBIN;\r\n\r\n$commandLineArgs = new CCommandLineArgs;\r\n\r\n$commandLineArgs->AddArgument(''delete''); //Action\r\n\r\nif ($IsAdmin)\r\n{ \r\n // $UserIdentifier is interpreted as an admin name\r\n $adminInfo = db_arr("SELECT `Name`\r\n FROM Admins\r\n WHERE `Name` = ''".$UserIdentifier."''");\r\n if (! $adminInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown admin ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($adminInfo[''Name'']);\r\n}\r\nelse \r\n{\r\n // $UserIdentifier is interpreted as a profile ID\r\n $UserIdentifier = (int)$UserIdentifier;\r\n \r\n $userInfo = db_arr("SELECT `NickName` \r\n FROM `Profiles`\r\n WHERE `ID` = {$UserIdentifier}");\r\n if (! $userInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown user ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($userInfo[''NickName'']);\r\n}\r\n\r\nif (chdir($dir[''root''] . $mods[''phpmc''][''ChatDirectory'']))\r\n{\r\n $scriptReturnValue = ''value_was_not_set'';\r\n exec("{$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine(), $scriptOutput, $scriptReturnValue);\r\n if ($scriptReturnValue !== 0)\r\n {\r\n echo "phpmc_register.cmd.php output:
\\n";\r\n foreach ($scriptOutput as $outputLine)\r\n {\r\n echo $outputLine.''
\\n'';\r\n }\r\n echo ''------------------------------------------
'';\r\n modules_err("FuncUpdate(): exec({$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine().") returned ".$scriptReturnValue);\r\n } \r\n}\r\nelse \r\n{\r\n modules_err("FuncUpdate(): chdir({$dir[''root'']}{$mods[''phpmc''][''ChatDirectory'']} returned false");\r\n}', '/**\r\n* FuncUpdate procedure for phpMyChat\r\n* \r\n* @param string $UserIdentifier member ID or admin name (depend on $IsAdmin parameter)\r\n* \r\n* @param boolean $IsAdmin Defines whether user is a simple member or admin\r\n*/\r\n\r\nglobal $dir;\r\nglobal $mods;\r\nglobal $site;\r\nglobal $PHPBIN;\r\nglobal $prof; // If prof.inc.php was included already\r\n\r\nrequire_once($dir[''inc''].''prof.inc.php''); // To retreive country name\r\n\r\n$commandLineArgs = new CCommandLineArgs;\r\n\r\n$commandLineArgs->AddArgument(''update''); //Action\r\n\r\nif ($IsAdmin)\r\n{ \r\n // $UserIdentifier is interpreted as an admin name\r\n $adminInfo = db_arr("SELECT `Name`,\r\n `Password`\r\n FROM Admins\r\n WHERE `Name` = ''".$UserIdentifier."''");\r\n\r\n if (! $adminInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown admin ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($adminInfo[''Name'']);\r\n $commandLineArgs->AddArgument($adminInfo[''Password'']);\r\n \r\n $commandLineArgs->AddArgument(_t(''_aeDating Administrator'')); // Real name\r\n $commandLineArgs->AddArgument(''''); // Country\r\n $commandLineArgs->AddArgument($site[''url'']); // URL (site address)\r\n $commandLineArgs->AddArgument($site[''email'']); // E-mail\r\n $commandLineArgs->AddArgument(1); // Show email\r\n $commandLineArgs->AddArgument(2); // Sex (undefined)\r\n}\r\nelse \r\n{\r\n // $UserIdentifier is interpreted as a profile ID\r\n $UserIdentifier = (int)$UserIdentifier;\r\n \r\n $userInfo = db_arr("SELECT `NickName`, \r\n `Password`, \r\n `Email`, \r\n `RealName`,\r\n `Country`,\r\n `Sex` \r\n FROM `Profiles`\r\n WHERE `ID` = {$UserIdentifier}");\r\n\r\n if (! $userInfo)\r\n {\r\n modules_err("FuncUpdate error: Unknown user ID [{$UserIdentifier}]");\r\n }\r\n\r\n $commandLineArgs->AddArgument($userInfo[''NickName'']);\r\n $commandLineArgs->AddArgument($userInfo[''Password'']);\r\n $commandLineArgs->AddArgument($userInfo[''RealName'']); \r\n $commandLineArgs->AddArgument($prof[''countries''][$userInfo[''Country'']]);\r\n $commandLineArgs->AddArgument($site[''url''].''profile.cmd.php?ID=''.$UserIdentifier); // set user URL as path of profile view page\r\n $commandLineArgs->AddArgument($userInfo[''Email'']);\r\n $commandLineArgs->AddArgument(! (bool)getParam(''anon_mode'')); // set ''Show email'' against of anonymouse mode\r\n $commandLineArgs->AddArgument($userInfo[''Sex'']); \r\n}\r\n\r\n$commandLineArgs->AddArgument((int)$IsAdmin);\r\n\r\nif (chdir($dir[''root''] . $mods[''phpmc''][''ChatDirectory'']))\r\n{\r\n $scriptReturnValue = ''value_was_not_set'';\r\n exec("{$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine(), $scriptOutput, $scriptReturnValue);\r\n if ($scriptReturnValue !== 0)\r\n {\r\n echo "phpmc_register.cmd.php output:
\\n";\r\n foreach ($scriptOutput as $outputLine)\r\n {\r\n echo $outputLine.''
\\n'';\r\n }\r\n echo ''------------------------------------------
'';\r\n modules_err("FuncUpdate(): exec({$PHPBIN} -f phpmc_register.cmd.php ".$commandLineArgs->GetCommandLine().") returned ".$scriptReturnValue);\r\n } \r\n}\r\nelse \r\n{\r\n modules_err("FuncUpdate(): chdir({$dir[''root'']}{$mods[''phpmc''][''ChatDirectory'']} returned false");\r\n}', '/**\r\n* FuncBlock procedure for phpMyChat\r\n* \r\n* @param string $UserIdentifier member ID or admin name (depend on $IsAdmin parameter)\r\n*/\r\n\r\nglobal $dir;\r\nglobal $mods;\r\nglobal $site;\r\nglobal $PHPBIN;\r\n\r\n$commandLineArgs = new CCommandLineArgs;\r\n\r\n$commandLineArgs->AddArgument(''block''); // action\r\n\r\n// $UserIdentifier is interpreted as a profile ID\r\n$UserIdentifier = (int)$UserIdentifier;\r\n \r\n$userInfo = db_arr("SELECT `NickName`\r\n FROM `Profiles`\r\n WHERE `ID` = {$UserIdentifier}");\r\nif (! $userInfo)\r\n{\r\n modules_err("FuncBlock error: Unknown user ID [{$UserIdentifier}]");\r\n}\r\n\r\n$commandLineArgs->AddArgument($userInfo[''NickName'']);\r\n\r\nif (chdir($dir[''root''] . $mods[''phpmc''][''ChatDirectory'']))\r\n{\r\n $scriptReturnValue = ''value_was_not_set''; \r\n exec("{$PHPBIN} -f phpmc_block.cmd.php ".$commandLineArgs->GetCommandLine(), $scriptOutput, $scriptReturnValue);\r\n if ($scriptReturnValue !== 0)\r\n {\r\n echo "phpmc_block.cmd.php output:
\\n";\r\n foreach ($scriptOutput as $outputLine)\r\n {\r\n echo $outputLine.''
\\n'';\r\n }\r\n echo ''------------------------------------------
'';\r\n modules_err("FuncBlock(): exec({$PHPBIN}-f phpmc_block.cmd.php ".$commandLineArgs->GetCommandLine().") returned ".$scriptReturnValue);\r\n }\r\n}\r\nelse \r\n{\r\n modules_err("FuncBlock(): chdir({$dir[''root'']}{$mods[''phpmc''][''ChatDirectory'']} returned false");\r\n}', '/**\r\n* FuncUnblock procedure for phpMyChat\r\n* \r\n* @param string $UserIdentifier member ID or admin name (depend on $IsAdmin parameter)\r\n*/\r\n\r\nglobal $dir;\r\nglobal $mods;\r\nglobal $site;\r\nglobal $PHPBIN;\r\n\r\n$commandLineArgs = new CCommandLineArgs;\r\n\r\n$commandLineArgs->AddArgument(''unblock''); // action\r\n\r\n// $UserIdentifier is interpreted as a profile ID\r\n$UserIdentifier = (int)$UserIdentifier;\r\n \r\n$userInfo = db_arr("SELECT `NickName`\r\n FROM `Profiles`\r\n WHERE `ID` = {$UserIdentifier}");\r\nif (! $userInfo)\r\n{\r\n modules_err("FuncUnblock error: Unknown user ID [{$UserIdentifier}]");\r\n}\r\n\r\n$commandLineArgs->AddArgument($userInfo[''NickName'']);\r\n\r\nif (chdir($dir[''root''] . $mods[''phpmc''][''ChatDirectory'']))\r\n{\r\n $scriptReturnValue = ''value_was_not_set''; \r\n exec("{$PHPBIN} -f phpmc_block.cmd.php ".$commandLineArgs->GetCommandLine(), $scriptOutput, $scriptReturnValue);\r\n if ($scriptReturnValue !== 0)\r\n {\r\n echo "phpmc_block.cmd.php output:
\\n";\r\n foreach ($scriptOutput as $outputLine)\r\n {\r\n echo $outputLine.''
\\n'';\r\n }\r\n echo ''------------------------------------------
'';\r\n modules_err("FuncUnblock(): exec({$PHPBIN} -f phpmc_block.cmd.php ".$commandLineArgs->GetCommandLine().") returned ".$scriptReturnValue);\r\n } \r\n}\r\nelse \r\n{\r\n modules_err("FuncUnblock(): chdir({$dir[''root'']}{$mods[''phpmc''][''ChatDirectory'']} returned false");\r\n}', '', 'global $mods;\r\n\r\n$POSTParams = array();\r\n$userData = array();\r\n\r\nif ($IsAdmin)\r\n{\r\n // $UserIdentifier is interpreted as an admin name\r\n $arrAdmin = db_arr("SELECT `Name`, \r\n `Password`\r\n FROM `Admins`\r\n WHERE `Name` = ''".addslashes($UserIdentifier)."''");\r\n if (! $arrAdmin)\r\n {\r\n modules_err("FuncLogin error: Unknown admin name ''{$UserIdentifier}''");\r\n }\r\n \r\n $POSTParams[''AUTH_USERNAME''] = $arrAdmin[''Name''];\r\n $POSTParams[''AUTH_PASSWORD''] = $arrAdmin[''Password''];\r\n \r\n Redirect($mods[''phpmc''][''ChatDirectory''].''admin.php3'', $POSTParams, "post");\r\n}\r\nelse \r\n{\r\n // $UserIdentifier is interpreted as a profile ID\r\n $arrMember = db_arr("SELECT `NickName`,\r\n `Password`\r\n FROM `Profiles`\r\n WHERE `ID` = ".(int)$UserIdentifier);\r\n if (! $arrMember)\r\n {\r\n modules_err("FuncLogin error: Unknown user ID [{$UserIdentifier}]");\r\n }\r\n \r\n $POSTParams[''U''] = $arrMember[''NickName''];\r\n $POSTParams[''PASSWORD''] = $arrMember[''Password''];\r\n $POSTParams[''Form_Send''] = 1;\r\n $POSTParams[''N''] = 20;\r\n \r\n Redirect($mods[''phpmc''][''ChatDirectory''].''index.php3'', $POSTParams, "post");\r\n}\r\n', 'chat', 'phpMyChat');