. * */ define('APP_ROOT', '..'); require_once APP_ROOT.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR.'init.php'; SP_Util::checkReferer('POST'); if (!SP_Init::isLoggedIn()) { SP_Common::printJSON(_('La sesión no se ha iniciado o ha caducado'), 10); } $sk = SP_Common::parseParams('p', 'sk', false); if (!$sk || !SP_Common::checkSessionKey($sk)) { SP_Common::printJSON(_('CONSULTA INVÁLIDA')); } $frmAccountId = SP_Common::parseParams('p', 'accountid', 0); $frmDescription = SP_Common::parseParams('p', 'description'); if (!$frmDescription) { SP_Common::printJSON(_('Es necesaria una descripción')); } $accountRequestData = SP_Account::getAccountRequestData($frmAccountId); $recipients = array( SP_Users::getUserEmail($accountRequestData->account_userId), SP_Users::getUserEmail($accountRequestData->account_userEditId) ); $requestUsername = SP_Common::parseParams('s', 'uname'); $requestLogin = SP_Common::parseParams('s', 'ulogin'); $message['action'] = _('Solicitud de Modificación de Cuenta'); $message['text'][] = SP_Html::strongText(_('Solicitante') . ': ') . $requestUsername . ' (' . $requestLogin . ')'; $message['text'][] = SP_Html::strongText(_('Cuenta') . ': ') . $accountRequestData->account_name; $message['text'][] = SP_Html::strongText(_('Cliente') . ': ') . $accountRequestData->customer_name; $message['text'][] = SP_Html::strongText(_('Descripción') . ': ') . $frmDescription; $mailto = implode(',', $recipients); if ($mailto && SP_Util::mailrequestIsEnabled() && SP_Common::sendEmail($message, $mailto) ) { SP_Log::wrLogInfo($message); SP_Common::printJSON(_('Solicitud enviada'), 0, "doAction('accsearch');"); } SP_Common::printJSON(_('Error al enviar la solicitud'));