From: <zy...@us...> - 2015-01-28 19:42:55
|
Revision: 12951 http://sourceforge.net/p/xoops/svn/12951 Author: zyspec Date: 2015-01-28 19:42:52 +0000 (Wed, 28 Jan 2015) Log Message: ----------- * Improved module update script to add some error reporting on failure(s) * Fixed bug in subdirectory removal script on update * added KEY(s) to dB table to improve search performance * changed ContactContactHandler->infoProcessing() to use XoopsRequest * sort departments alphabetically when displayed on contact form * Replaced "Reply" text in admin (./admin/contact.php) with icons * Changed "Submitter" information in admin to be able to email from contact page * Improved ContactContact->contactSendMail() method to improve anti-spam score * Minor source code formatting cleanup Modified Paths: -------------- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/ajax.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/changelog.txt XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/header.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions_update.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/index.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/help.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/modinfo.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/sql/mysql.sql XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_contact.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/contact_index.tpl XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/xoops_version.php Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/about.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_footer.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/admin_header.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -29,6 +29,8 @@ include_once $GLOBALS['xoops']->path('www/class/pagenav.php'); include_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); +xoops_load('XoopsRequest'); + $thisModuleDir = $GLOBALS['xoopsModule']->getVar('dirname'); // Load language files @@ -36,8 +38,8 @@ xoops_loadLanguage('modinfo', $thisModuleDir); xoops_loadLanguage('main', $thisModuleDir); -$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons16')); -$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons32')); +$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons16')); +$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('icons32')); $pathModuleAdmin = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin')); require_once "{$pathModuleAdmin}/moduleadmin/moduleadmin.php"; $admin_class = new ModuleAdmin(); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/contact.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -53,18 +53,15 @@ switch ($op) { case 'list': default: + $pageSettingsObj = new stdClass(); // create a new stdClass object + $pageSettingsObj->perpage = (int) $GLOBALS['xoopsModuleConfig']['admin_perpage']; + $pageSettingsObj->order = 'DESC'; + $pageSettingsObj->sort = 'contact_id'; + $pageSettingsObj->limit = XoopsRequest::getInt('limit', $pageSettingsObj->perpage); + $pageSettingsObj->start = XoopsRequest::getInt('start', 0); - $pageSettings = array('perpage' => $GLOBALS['xoopsModuleConfig']['admin_perpage'], - 'order' => 'DESC', - 'sort' => 'contact_id' - ); - $pageSettingsObj = (object) $pageSettings; //cast contact to a stdClass object - $pageSettingsObj->limit = XoopsRequest::getInt('limit', $pageSettingsObj->perpage); - $pageSettingsObj->start = XoopsRequest::getInt('start', 0); - - $contactCount = $contact_handler->contactGetCount('contact_cid'); //count all contacts - $contacts = $contact_handler->getAdminList($pageSettingsObj, 'contact_cid'); + $contacts = $contact_handler->getAdminList($pageSettingsObj, 'contact_cid'); if ($contactCount > $pageSettingsObj->limit) { $contactPageNavObj = new XoopsPageNav($contactCount, $pageSettingsObj->limit, $pageSettingsObj->start, 'start', 'limit=' . $pageSettingsObj->limit); @@ -81,7 +78,6 @@ break; case 'reply': - if ($contactId > 0) { $obj = $contact_handler->get($contactId); if (!($obj instanceof contact) || (0 != $obj->getVar('contact_cid'))) { @@ -101,8 +97,7 @@ break; case 'doreply': - - $formInput = $contact_handler->infoProcessing($_POST); + $formInput = $contact_handler->infoProcessing('POST'); $mailObj = (object) $formInput; unset($formInput); $deptEmails = array(); @@ -150,7 +145,6 @@ break; case 'view': - $obj = $contact_handler->get($contactId); if (!$obj) { @@ -172,7 +166,6 @@ break; case 'delete': - if (!$contactId) { redirect_header($_SERVER['PHP_SELF'], 3, _AM_CONTACT_MSG_NOTEXIST); exit(); @@ -183,7 +176,6 @@ break; case 'dodelete': - // check to make sure this passes form submission security if ( ($GLOBALS['xoopsSecurity'] instanceof XoopsSecurity) ) { if ( !$GLOBALS['xoopsSecurity']->check() ) { Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/index.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/log.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/menu.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/admin/prune.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/ajax.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -25,7 +25,7 @@ if (!empty($_POST)) { // Info Processing - $mailFormContents = $contact_handler->infoProcessing($_POST); + $mailFormContents = $contact_handler->infoProcessing('POST''); $mailObj = (object) $mailFormContents; // Save info $contactObj = $contact_handler->create(); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/index.html 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/assets/index.html 2015-01-28 19:42:52 UTC (rev 12951) @@ -1 +1,2 @@ - <script>history.go(-1);</script> \ No newline at end of file + +<script>history.go(-1);</script> \ No newline at end of file Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/blocks/stats.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact stats.php * @@ -58,7 +58,6 @@ include_once $GLOBALS['xoops']->path( "modules/{$dirname}/include/functions.php"); // include_once '../include/functions.php'; $moduleMgr = contactGetModuleManager(); - if ($moduleMgr->config['form_dept']) { /* $module_handler =& xoops_gethandler('module'); $module =& $module_handler->getByDirname($dirname); @@ -66,6 +65,7 @@ $contactConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); if ($contactConfig['form_dept']) { */ + if ($moduleMgr->config['form_dept']) { $criteria = new CriteriaCompo(); $criteria->add(new Criteria('contact_cid', 0)); $criteria->add(new Criteria('contact_type', 'Contact')); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/contact.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -23,7 +23,6 @@ */ //defined("XOOPS_ROOT_PATH") || exit("Restricted access - " . basename($_SERVER['PHP_SELF'], '.php') . PHP_EOL); - class Contact extends XoopsObject { @@ -131,10 +130,14 @@ // show a drop down with the departments listed $departmentlist = new XoopsFormSelect(_MD_CONTACT_DEPARTMENT, 'contact_department'); $departments = $GLOBALS['xoopsModuleConfig']['contact_dept']; + $listOptions = array(); foreach ($departments as $val) { $valexplode = explode(',', $val); - $departmentlist->addOption($valexplode[0]); + $listOptions[$valexplode[0]] = $valexplode[0]; +// $departmentlist->addOption($valexplode[0]); } + asort($listOptions); + $departmentlist->addOptionArray($listOptions); $form->addElement($departmentlist); } else { $form->addElement(new XoopsFormHidden('contact_department', '')); @@ -301,41 +304,59 @@ /** * * Clean all the incoming Vars from Form(s) - * @param $global global var array ($_POST, $_GET, $_REQUEST) - * @uses {@link Contact::contactCleanVars} + * @param $global global var array (POST, GET, REQUEST) + * @uses {@link XoopsRequest} * * @return array containing clean versions of form variables */ - public function infoProcessing(&$global) + public function infoProcessing($global) { + xoops_load('XoopsRequest'); $contact = array(); - - $contact['contact_cid'] = $this->contactCleanVars($global, 'contact_id', '', 'int'); - $contact['contact_uid'] = $this->contactCleanVars($global, 'contact_uid', '', 'int'); - $contact['contact_name'] = $this->contactCleanVars($global, 'contact_name', '', 'text'); //mb changed from string to text - $contact['contact_namefrom'] = $this->contactCleanVars($global, 'contact_namefrom', '', 'text'); -// $contact['contact_nameto'] = $this->contactCleanVars($global, 'contact_nameto', '', 'text'); //mb changed from string to text - $contact['contact_subject'] = $this->contactCleanVars($global, 'contact_subject', '', 'text'); //mb changed from string to text - $contact['contact_mailfrom'] = $this->contactCleanVars($global, 'contact_mailfrom', '', 'mail'); - $contact['contact_mail'] = $this->contactCleanVars($global, 'contact_mail', '', 'mail'); - $contact['contact_mail2'] = $this->contactCleanVars($global, 'contact_mail2', '', 'mail'); -// $contact['contact_mailto'] = $this->contactCleanVars($global, 'contact_mailto', '', 'mail'); - $contact['contact_url'] = $this->contactCleanVars($global, 'contact_url', '', 'url'); + if (empty($global)) { // will get from $_REQUEST + $from = null; + } elseif (('POST' == strtoupper($global)) || ('GET' == strtoupper($global))) { + $from = strtoupper($global); // will get specifically from $_GET or $_POST + } else { // don't allow other sources + return $contact; + } + $contact['contact_cid'] = XoopsRequest::getInt('contact_id', '', $from); + $contact['contact_uid'] = XoopsRequest::getInt('contact_uid', '', $from); + $contact['contact_name'] = XoopsRequest::getText('contact_name', '', $from); + $contact['contact_namefrom'] = XoopsRequest::getText('contact_namefrom', '', $from); + /* + $contact['contact_nameto'] = XoopsRequest::getText('contact_nameto', '', $from); + */ + $contact['contact_subject'] = XoopsRequest::getText('contact_subject', '', $from); + $email = XoopsRequest::getText('contact_mailfrom', '', $from); + $contact['contact_mailfrom'] = checkEmail($email); + $email = XoopsRequest::getText('contact_mail', '', $from); + $contact['contact_mail'] = checkEmail($email); + $email = XoopsRequest::getText('contact_mail2', '', $from); + $contact['contact_mail2'] = checkEmail($email); + /* + $email = XoopsRequest::getText('contact_mailto', '', $from); + $contact['contact_mailto'] = checkEmail($email); + */ + $url = XoopsRequest::getText('contact_url', '', $from); + $contact['contact_url'] = (!empty($url)) ? filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED) : ''; $contact['contact_create'] = time(); - $contact['contact_icq'] = $this->contactCleanVars($global, 'contact_icq', '', 'text'); //mb changed from string to text - $contact['contact_company'] = $this->contactCleanVars($global, 'contact_company', '', 'text'); //mb changed from string to text - $contact['contact_location'] = $this->contactCleanVars($global, 'contact_location', '', 'text'); - $contact['contact_phone'] = $this->contactCleanVars($global, 'contact_phone', '', 'int'); - $contact['contact_department'] = $this->contactCleanVars($global, 'contact_department', _MD_CONTACT_DEFULTDEP, 'string'); + $contact['contact_icq'] = XoopsRequest::getText('contact_icq', '', $from); + $contact['contact_company'] = XoopsRequest::getText('contact_company', '', $from); + $contact['contact_location'] = XoopsRequest::getText('contact_location', '', $from); + $contact['contact_phone'] = XoopsRequest::getInt('contact_phone', '', $from); + $contact['contact_department'] = XoopsRequest::getText('contact_department', _MD_CONTACT_DEFULTDEP, $from); $contact['contact_ip'] = getenv("REMOTE_ADDR"); - $contact['contact_message'] = $this->contactCleanVars($global, 'contact_message', '', 'text'); - $contact['contact_address'] = $this->contactCleanVars($global, 'contact_address', '', 'text'); - $contact['contact_platform'] = $this->contactCleanVars($global, 'contact_platform', 'Web', 'platform'); - $contact['contact_type'] = $this->contactCleanVars($global, 'contact_type', 'Contact', 'type'); - $contact['send_dept'] = $this->contactCleanVars($global, 'send_dept' , 0, 'int'); - $contact['contact_orig_message'] = $this->contactCleanVars($global, 'contact_orig_message' , '', 'text'); - $contact['inc_orig'] = $this->contactCleanVars($global, 'inc_orig', 0, 'int'); + $contact['contact_message'] = XoopsRequest::getText('contact_message', '', $from); + $contact['contact_address'] = XoopsRequest::getText('contact_address', '', $from); + $platform = XoopsRequest::getText('contact_platform', '', $from); + $contact['contact_platform'] = $this->contactPlatform($platform); + $type = XoopsRequest::getText('contact_type', '', $from); + $contact['contact_type'] = $this->contactType($type); + $contact['send_dept'] = XoopsRequest::getInt('send_dept' , 0, $from); + $contact['contact_orig_message'] = XoopsRequest::getText('contact_orig_message' , '', $from); + $contact['inc_orig'] = XoopsRequest::getInt('inc_orig', 0, $from); return $contact; } @@ -361,17 +382,35 @@ } else { $xoopsMailer->setToEmails($GLOBALS['xoopsConfig']['adminmail']); //just send to admin } + if (!in_array($GLOBALS['xoopsConfig']['adminmail'], $deptEmailAddresses)) { + $xoopsMailer->multimailer->addBCC($GLOBALS['xoopsConfig']['adminmail'], 'TMC Administrator'); + } + xoops_loadLanguage('modinfo', 'contact'); // get the language string(s) $myts =& MyTextSanitizer::getInstance(); - $xoopsMailer->setFromName(stripslashes(strip_tags(html_entity_decode($mailObj->contact_name, ENT_QUOTES, 'UTF-8')))); + // pre-process FromName since it came from input field + $fromName = stripslashes(strip_tags(html_entity_decode($mailObj->contact_name, ENT_QUOTES, 'UTF-8'))); + // pre-process Subject since it came from input field + $mailSubject = stripslashes(strip_tags(html_entity_decode($mailObj->contact_subject, ENT_QUOTES, 'UTF-8'))); + + $xoopsMailer->setFromName(ucwords($fromName)); $xoopsMailer->setFromEmail($mailObj->contact_mail); - $xoopsMailer->setSubject(stripslashes(strip_tags(html_entity_decode($mailObj->contact_subject, ENT_QUOTES, 'UTF-8')))); $thisBody = stripslashes(html_entity_decode($mailObj->contact_message, ENT_QUOTES, 'UTF-8')); - $thisBody = $xoopsMailer->multimailer->WrapText($thisBody, 80); +// $thisBody = $xoopsMailer->multimailer->WrapText($thisBody, 80); +// $xoopsMailer->multimailer->set('FromName', ucwords($fromName)); + $xoopsMailer->multimailer->setFrom($mailObj->contact_mail, ucwords($fromName)); + $xoopsMailer->multimailer->set('Subject', $mailSubject); + $xoopsMailer->multimailer->WordWrap = 80; // force wrap of body text at 80 chars for 'bad' clients + $xoopsMailer->multimailer->set('Body', $thisBody); + $xoopsMailer->multimailer->set('AltBody', $thisBody); + $xoopsMailer->setSubject($mailSubject); $xoopsMailer->setBody($thisBody); - - if ($xoopsMailer->send()) { - $message = $myts->htmlSpecialChars($GLOBALS['xoopsModuleConfig']['contact_thankyou']); + if ($xoopsMailer->send($debug = false)) { + if ($debug) { + $message = $xoopsMailer->getSuccess(); + } else { + $message = $myts->htmlSpecialChars($GLOBALS['xoopsModuleConfig']['contact_thankyou']); + } } else { $message = $xoopsMailer->getErrors(); } Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/class/formvalidatedinput.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact form element for form input Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/ajax.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/ajax.html 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/ajax.html 2015-01-28 19:42:52 UTC (rev 12951) @@ -1,6 +1,11 @@ -<script src="<{$xoops_url}>/browse.php?Frameworks/jquery/jquery.js" type="text/javascript"></script> -<script src="<{$xoops_url}>/browse.php?Frameworks/jquery/plugins/jquery.ui.js" type="text/javascript"></script> -<link rel="stylesheet" href="<{$xoops_url}>/modules/system/css/ui/base/ui.all.css" type="text/css"/> +<script src="<{$xoops_url}>/browse.php?Frameworks/jquery/jquery.js" + type="text/javascript"></script> +<script + src="<{$xoops_url}>/browse.php?Frameworks/jquery/plugins/jquery.ui.js" + type="text/javascript"></script> +<link rel="stylesheet" + href="<{$xoops_url}>/modules/system/css/ui/base/ui.all.css" + type="text/css" /> <script type="text/javascript"> $(function () { @@ -43,27 +48,31 @@ </script> <div class="demo"> - <div id="dialog-form" title="Contact Us"> - <p class="validateTips">Contact us</p> + <div id="dialog-form" title="Contact Us"> + <p class="validateTips">Contact us</p> - <form enctype="multipart/form-data"> - <{xoMemberInfo assign=member_info}> - <label for="name">Name</label> - <input name="contact_name" title="Name" id="contact_name" size="20" maxlength="255" value="<{$xoops_uname}>" type="text" - class="text ui-widget-content ui-corner-all"/> - <br/><label for="email">Email</label> - <input name="contact_mail" title="Email" id="contact_mail" size="20" maxlength="255" value="<{$member_info.email}>" type="text" - class="text ui-widget-content ui-corner-all"/> - <br/><label for="password">Phone</label> - <input name="contact_phone" title="Phone" id="contact_phone" size="20" maxlength="255" value="" type="text" - class="text ui-widget-content ui-corner-all"/> - <br/><label for="password">Subject</label> - <input name="contact_subject" title="Subject" id="contact_subject" size="20" maxlength="255" value="" type="text" - class="text ui-widget-content ui-corner-all"/> - <br/><label for="password">Comment</label> - <textarea name="contact_message" id="contact_message" title="Comment" rows="5" cols="60"></textarea> - <input name="contact_uid" id="contact_uid" value="<{$xoops_userid}>" type="hidden"> - </form> - </div> - <button id="create-user">Contact Us</button> + <form enctype="multipart/form-data"> + <{xoMemberInfo assign=member_info}> <label for="name">Name</label> <input + name="contact_name" title="Name" id="contact_name" size="20" + maxlength="255" value="<{$xoops_uname}>" type="text" + class="text ui-widget-content ui-corner-all" /> <br /> + <label for="email">Email</label> <input name="contact_mail" + title="Email" id="contact_mail" size="20" maxlength="255" + value="<{$member_info.email}>" type="text" + class="text ui-widget-content ui-corner-all" /> <br /> + <label for="password">Phone</label> <input name="contact_phone" + title="Phone" id="contact_phone" size="20" maxlength="255" value="" + type="text" class="text ui-widget-content ui-corner-all" /> <br /> + <label for="password">Subject</label> <input name="contact_subject" + title="Subject" id="contact_subject" size="20" maxlength="255" + value="" type="text" class="text ui-widget-content ui-corner-all" /> + <br /> + <label for="password">Comment</label> + <textarea name="contact_message" id="contact_message" title="Comment" + rows="5" cols="60"></textarea> + <input name="contact_uid" id="contact_uid" value="<{$xoops_userid}>" + type="hidden"> + </form> + </div> + <button id="create-user">Contact Us</button> </div> Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/changelog.txt =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/changelog.txt 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/docs/changelog.txt 2015-01-28 19:42:52 UTC (rev 12951) @@ -1,12 +1,19 @@ +<u>Version 1.82 Beta 3 from 2015-1-28</u> +- Improved module update script to add some error reporting on failure(s) +- Fixed bug in subdirectory removal script on update +- added KEY(s) to dB table to improve search performance +- changed ContactContactHandler->infoProcessing() to use XoopsRequest +- sort departments alphabetically when displayed on contact form +- Replaced "Reply" text in admin (./admin/contact.php) with icons +- Changed "Submitter" information in admin to be able to email from contact page +- Improved ContactContact->contactSendMail() method to improve anti-spam score -Version 1.82 from 2014-12-03 Beta 2 -================================= -- Replaced ContactContact->contactCleanVars function with XoopsRequest -- changed to use exit() instead of die() for consistency -- minor phpdocumentor updates +<u>Version 1.82 Beta 2 from 2014-12-03</u> +- Replaced ContactContactHandler->contactCleanVars function with XoopsRequest +- Changed to use exit() instead of die() for consistency +- Minor phpdocumentor updates -Version 1.82 from 2014-11-25 Beta 1 -================================= +<u>Version 1.82 Beta 1 from 2014-11-25</u> - Added ability to require visitors to enter email 2X on form (ZySpec) - Added features page to Admin help (ZySpec) - Added date select to Admin log form (ZySpec) @@ -32,8 +39,7 @@ - Updated documentation files (changelog.txt, readme.txt) (ZySpec) - Minor code cleanup (ZySpec) -Version 1.81 from 2013-02-24 -================================= +<u>Version 1.81 from 2013-02-24</u> - Rebuild Module (Voltan) - English corrections (Cesag) - PSR-2 code reformatting (Mamba) @@ -47,17 +53,14 @@ - moved all images, CSS, and JS files to /assets (Mamba) - renamed .html Smarty templates to .tpl (Mamba) -Version 1.80 from 2012-1-19 -================================= +<u>Version 1.80 from 2012-1-19</u> - Rebuild Module (Voltan) -Version 1.71 from 2011-12-12 -================================= -- converted to XOOPS Standard Module GUI (Mamba) -- included ModuleAdmin class from (Mage) +<u>Version 1.71 from 2011-12-12</u> +- Converted to XOOPS Standard Module GUI (Mamba) +- Included ModuleAdmin class from (Mage) -Version 1.70 from 11-08-2010 -================================= -- added 2.4.x compatibilty (Trabis) -- added php5.3 compatibilty (Trabis) -- added error checking while sending emails (Trabis) +<u>Version 1.70 from 11-08-2010</u> +- Added 2.4.x compatibilty (Trabis) +- Added php5.3 compatibilty (Trabis) +- Added error checking while sending emails (Trabis) Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/header.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/header.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/header.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -21,7 +21,7 @@ * @version $Id: $ */ -defined("XOOPS_ROOT_PATH") || exit("Restricted access - " . basename($_SERVER['PHP_SELF'], '.php') . PHP_EOL); +defined("XOOPS_ROOT_PATH") || exit("Restricted access"); /** * @@ -47,7 +47,7 @@ if ($contactConfig['form_dept']) { // using departments */ if ($moduleMgr->config['form_dept']) { // using departments - // show a drop down with the correct departments listed + // show a drop down with the correct departments listed $myts =& MyTextSanitizer::getInstance(); $depts = $moduleMgr->config['contact_dept']; // $depts = explode('|', $contactConfig['contact_dept']); @@ -93,7 +93,7 @@ $departments = contactGetDepartments(); $dept_emails = array(); foreach ($departments as $thisDept) { - $dept_emails[$thisDept['name']][] = $thisDept['email']; + $dept_emails[$thisDept['name']][] = $thisDept['email']; } if ('' != $dept && array_key_exists($dept, $dept_emails)) { $dept_emails = $dept_emails[$dept]; @@ -125,7 +125,7 @@ $departments = contactGetDepartments(); $dept_names = array(); foreach ($departments as $thisDept) { - $dept_names[] = $thisDept['name']; + $dept_names[] = $thisDept['name']; } $dept_names = array_unique($dept_names); //get rid of duplicates } Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions_update.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions_update.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/functions_update.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -23,7 +23,6 @@ /** * @internal {Make sure you PROTECT THIS FILE - * * This code has the potential to be extremely dangerous!!} */ @@ -31,7 +30,7 @@ || !($GLOBALS['xoopsUser'] instanceof XoopsUser) || !($GLOBALS['xoopsUser']->IsAdmin())) { - exit("Restricted access - " . basename($_SERVER['PHP_SELF']) . PHP_EOL); + exit("Restricted access - " . basename($_SERVER['PHP_SELF']) . PHP_EOL); } function rmmdir($dir) @@ -41,19 +40,23 @@ * - the routine is intentionally limitted for this * install routine's requirements} */ - $dir = preg_replace('/[^a-zA-Z\s\d\_\-]/', $dir); - $dir = $GLOBALS['xoops']->path("/" . $module->dirname . "/{$dir}"); - foreach (glob($dir . '/*') as $file) { - if (is_dir($file)) { - rrmdir($file); + $moduleDir = basename(dirname(__DIR__)); + $dir = preg_replace('/[^a-zA-Z\s\d\_\-\/]/', '', $dir); + $dir = trim($dir, " \t\n\r\0\x0B\/"); //trim leading/trailing spaces and '/' + $path = $GLOBALS['xoops']->path("www/modules/{$moduleDir}/{$dir}"); + $objs = array_diff(scandir($path), array('.','..')); // remove relative dirs + foreach ($objs as $obj) { + if (is_dir("{$path}/{$obj}")) { + rmmdir("{$dir}/{$obj}"); } else { - unlink($file); + unlink("{$path}/$obj"); } } - rmdir($dir); + + return rmdir($path); } -function xoops_module_update_contact($module, $version) +function xoops_module_update_contact(&$module, $version) { $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); @@ -76,46 +79,76 @@ contact_message text NOT NULL, contact_address text NOT NULL, contact_reply tinyint(1) NOT NULL, - PRIMARY KEY (contact_id) + PRIMARY KEY (contact_id), + KEY (contact_uid), + KEY (contact_cid), + KEY (contact_create), + KEY (contact_mail), + KEY (contact_phone), + KEY (contact_platform), + KEY (contact_type) ) ENGINE=MyISAM;"; - $xoopsDB->query($sql); + if (false === $xoopsDB->query($sql)) { + $module->setErrors('Failed to create module (< v1.80) database table'); + return false; + } } if ($version < 181) { + $retVal = true; // Add contact_platform $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'"; - $xoopsDB->query($sql); + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add contact_type $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'"; - $xoopsDB->query($sql); + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_uid - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_uid` ( `contact_uid` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_uid` (`contact_uid`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_cid - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_cid` ( `contact_cid` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_cid` (`contact_cid`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_create - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_create` ( `contact_create` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_create` (`contact_create`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_mail - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_mail` ( `contact_mail` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_mail` (`contact_mail`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_phone - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_phone` ( `contact_phone` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_phone` (`contact_phone`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_platform - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_platform` ( `contact_platform` )"; - $xoopsDB->query($sql); + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_platform` (`contact_platform`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; // Add index contact_type - $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_type` ( `contact_type` )"; - $xoopsDB->query($sql); - + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `contact_type` (`contact_type`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `replied` (`contact_cid`, `contact_reply`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; + $sql = "ALTER TABLE `" . $xoopsDB->prefix('contact') . "` ADD INDEX `typed_cid` (`contact_cid`, `contact_type`)"; + $success = $xoopsDB->query($sql); + $retVal = $retVal && $success; + if (false === $retVal) { + $module->setErrors('Could not update dB table (< v1.81)'); + return false; + } // do some file cleanup since directories/files were moved in this version $dirArray = array('css', 'images', 'js'); foreach ($dirArray as $dir) { - rrmdir($GLOBALS['xoops']->path("/$module->dirname/{$dir}")); + rmmdir($dir); } } + if ($version < 182) { //delete the /admin/tools.php file - it was renamed to purge.php in v1.82 $filename = $GLOBALS['xoops']->path("/" . $module->dirname() . "/admin/tools.php"); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/include/waiting.plugin.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact - waiting.php * @@ -23,7 +23,7 @@ */ function b_waiting_contact() { -// $contactDB =& XoopsDatabaseFactory::getDatabaseConnection(); + // $contactDB =& XoopsDatabaseFactory::getDatabaseConnection(); $block = array(); @@ -35,13 +35,13 @@ //check to see if module is active, return if not... if ($contactModule->isactive()) { // setup the contact messages - $contact_handler = & xoops_getModuleHandler('contact', 'contact'); + $contact_handler = & xoops_getModuleHandler('contact', $contactModule->dirname()); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('contact_cid', 0, '=')); //don't include replies $criteria->add(new Criteria('contact_reply', 0, '=')); // only include messages that haven't had a reply $messageCount = $contact_handler->getCount($criteria); if ($messageCount) { - $block = array('adminlink' => $GLOBALS['xoops']->url("www/modules/contact/admin/contact.php"), + $block = array('adminlink' => $GLOBALS['xoops']->url("www/modules/" . $contactModule->dirname() . "/admin/contact.php"), 'pendingnum' => $messageCount, 'lang_linkname' => _PI_CONTACT_WAITING_REPLY ); Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/index.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/index.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/index.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact module @@ -92,7 +92,7 @@ } // Info Processing - $mailFormResults = $contact_handler->infoProcessing($_POST); + $mailFormResults = $contact_handler->infoProcessing('POST'); $mailObj = (object) $mailFormResults; // insert in DB if ($saveinfo = true) { Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/blocks.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact - blocks.php * Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/help.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/help.html 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/help.html 2015-01-28 19:42:52 UTC (rev 12951) @@ -1,31 +1,37 @@ <div id="help-template" class="outer"> - <h1 class="head">Help: - <a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/contact/admin/index.php" - title="Back to the administration of Contact"> Contact - <img src="<{xoAdminIcons home.png}>" - alt="Back to the Administration of Contact"/> - </a></h1> + <h1 class="head"> + Help: <a class="ui-corner-all tooltip" + href="<{$xoops_url}>/modules/contact/admin/index.php" + title="Back to the administration of Contact"> Contact <img + src="<{xoAdminIcons home.png}>" + alt="Back to the Administration of Contact" /> + </a> + </h1> - <h4 class="odd">Description</h4><br/> + <h4 class="odd">Description</h4> + <br /> - <p style='margin-bottom: 1em;'>'Contact Us' is a very simple module. It provides a Main Menu link to a - contact form that visitors can use to email the website Administrator or - optionally a department.</p> - <p>You can set the content of the Contact Us form header in 'Preferences'</p> + <p style='margin-bottom: 1em;'>'Contact Us' is a very simple + module. It provides a Main Menu link to a contact form that visitors + can use to email the website Administrator or optionally a department.</p> + <p>You can set the content of the Contact Us form header in + 'Preferences'</p> - <h4 class="odd">Install/uninstall</h4><br/> + <h4 class="odd">Install/uninstall</h4> + <br /> No special measures necessary, follow the standard installation + process extract the /contact folder into the ./modules directory. + Install the module through Admin -> System Module -> Modules. <br /> + <br /> Detailed instructions on installing modules are available in the + <a href="http://goo.gl/adT2i">XOOPS Operations Manual</a><br /> + <br /> - No special measures necessary, follow the standard installation process - extract the /contact folder into the ./modules directory. Install the - module through Admin -> System Module -> Modules. <br/><br/> - Detailed instructions on installing modules are available in the - <a href="http://goo.gl/adT2i">XOOPS Operations Manual</a><br/><br/> + <h4 class="odd">Operating instructions</h4> + <br /> There is nothing really to do on the Admin site, except setting + preferences.<br /> + <br /> + <h4 class="odd">Tutorial</h4> + <br /> You can find a more detailed Tutorial <a + href="http://goo.gl/bz94i">here</a><br /> - <h4 class="odd">Operating instructions</h4><br/> - There is nothing really to do on the Admin site, except setting preferences.<br/><br/> - <h4 class="odd">Tutorial</h4><br/> - - You can find a more detailed Tutorial <a href="http://goo.gl/bz94i">here</a><br/> - </div> \ No newline at end of file Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/help/module_index.html 2015-01-28 19:42:52 UTC (rev 12951) @@ -1,22 +1,32 @@ <div id="help-template" class="outer"> - <h1 class="head">Help: - <a class="ui-corner-all tooltip" href="<{$xoops_url}>/modules/contact/admin/index.php" - title="Back to the administration of Contact"> Contact - <img src="<{xoAdminIcons home.png}>" - alt="Back to the Administration of Contact"/> - </a></h1> + <h1 class="head"> + Help: <a class="ui-corner-all tooltip" + href="<{$xoops_url}>/modules/contact/admin/index.php" + title="Back to the administration of Contact"> Contact <img + src="<{xoAdminIcons home.png}>" + alt="Back to the Administration of Contact" /> + </a> + </h1> - <h4 class="odd">Contact Module</h4> - <p style='margin: 1em 0;'>This module includes the following features:</p> - <ul> - <li style='height: 1.3em;'>Automatically emails contact form to requested contact</li> - <li style='height: 1.3em;'>Allows Administrator to reply to message from module control panel</li> - <li style='height: 1.3em;'>Stores Contact submission in database</li> - <li style='height: 1.3em;'>Allows Administrator to select type of information to collect (URL, Company Name, Location, Address, Phone, etc.)</li> - <li style='height: 1.3em;'>Supports contacting departments</li> - <li style='height: 1.3em;'>Form Captcha based on site settings</li> - <li style='height: 1.3em;'>Ability to require anonymous users to enter email twice on form to ensure it was entered correctly</li> - <li style='height: 1.3em;'>Provides log of users who have filled out Contact form</li> - <li style='height: 1.3em;'>Allows Administrator to prune (delete) messages from the database</li> - </ul> + <h4 class="odd">Contact Module</h4> + <p style='margin: 1em 0;'>This module includes the following + features:</p> + <ul> + <li style='height: 1.3em;'>Automatically emails contact form to + requested contact</li> + <li style='height: 1.3em;'>Allows Administrator to reply to + message from module control panel</li> + <li style='height: 1.3em;'>Stores Contact submission in database</li> + <li style='height: 1.3em;'>Allows Administrator to select type of + information to collect (URL, Company Name, Location, Address, Phone, + etc.)</li> + <li style='height: 1.3em;'>Supports contacting departments</li> + <li style='height: 1.3em;'>Form Captcha based on site settings</li> + <li style='height: 1.3em;'>Ability to require anonymous users to + enter email twice on form to ensure it was entered correctly</li> + <li style='height: 1.3em;'>Provides log of users who have filled + out Contact form</li> + <li style='height: 1.3em;'>Allows Administrator to prune (delete) + messages from the database</li> + </ul> </div> Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/modinfo.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/modinfo.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/modinfo.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact - modinfo.php * Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/language/english/waiting.php 2015-01-28 19:42:52 UTC (rev 12951) @@ -7,7 +7,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ + */ /** * Contact - waiting.php * Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/sql/mysql.sql =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/sql/mysql.sql 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/sql/mysql.sql 2015-01-28 19:42:52 UTC (rev 12951) @@ -1,29 +1,31 @@ CREATE TABLE contact ( - contact_id int(10) unsigned NOT NULL auto_increment, - contact_uid int(10) NOT NULL, - contact_cid int(10) NOT NULL, - contact_create int(10) NOT NULL, - contact_subject varchar(255) NOT NULL, - contact_name varchar(255) NOT NULL, - contact_mail varchar(255) NOT NULL, - contact_url varchar(255) NOT NULL, - contact_icq varchar(255) NOT NULL, - contact_company varchar(255) NOT NULL, - contact_location varchar(255) NOT NULL, - contact_department varchar(60) NOT NULL, - contact_ip varchar(20) NOT NULL, - contact_phone varchar(20) NOT NULL, - contact_message text NOT NULL, - contact_address text NOT NULL, - contact_reply tinyint(1) NOT NULL, - contact_platform enum('Android','Ios','Web') NOT NULL DEFAULT 'Web', - contact_type enum('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact', + `contact_id` int(10) unsigned NOT NULL auto_increment, + `contact_uid` int(10) NOT NULL, + `contact_cid` int(10) NOT NULL, + `contact_create` int(10) NOT NULL, + `contact_subject` varchar(255) NOT NULL, + `contact_name` varchar(255) NOT NULL, + `contact_mail` varchar(255) NOT NULL, + `contact_url` varchar(255) NOT NULL, + `contact_icq` varchar(255) NOT NULL, + `contact_company` varchar(255) NOT NULL, + `contact_location` varchar(255) NOT NULL, + `contact_department` varchar(60) NOT NULL, + `contact_ip` varchar(20) NOT NULL, + `contact_phone` varchar(20) NOT NULL, + `contact_message` text NOT NULL, + `contact_address` text NOT NULL, + `contact_reply` tinyint(1) NOT NULL, + `contact_platform` enum('Android','Ios','Web') NOT NULL DEFAULT 'Web', + `contact_type` enum('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact', PRIMARY KEY (contact_id), - KEY (contact_uid), - KEY (contact_cid), - KEY (contact_create), - KEY (contact_mail), - KEY (contact_phone), - KEY (contact_platform), - KEY (contact_type) + KEY (`contact_uid`), + KEY (`contact_cid`), + KEY (`contact_create`), + KEY (`contact_mail`), + KEY (`contact_phone`), + KEY (`contact_platform`), + KEY (`contact_type`), + KEY `replied` (`contact_cid`, `contact_reply`), + KEY `typed_cid` ('contact_cid`, `contact_type`) ) ENGINE=MyISAM; Modified: XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_contact.tpl =================================================================== --- XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_contact.tpl 2015-01-28 19:15:52 UTC (rev 12950) +++ XoopsModules/modulepacks/x257basicmodulepack/branches/zyspec/contact/templates/admin/contact_contact.tpl 2015-01-28 19:42:52 UTC (rev 12951) @@ -18,7 +18,11 @@ <td class="txtcenter bold"><a class="tooltip" title="<{$contact.contact_subject}>" href="contact.php?op=view&id=<{$contact.contact_id}>"><{$contact.contact_subject}></a></td> <td class="txtcenter"><{$contact.contact_create}></td> <td class="txtcenter"> - <{$contact.contact_name}> ( <{if $contact.contact_uid}><a title="<{$contact.contact_owner}>"href="<{$xoops_url}>/userinfo.php?uid=<{$contact.contact_uid}>"><{$contact.contact_owner}></a><{else}><{$contact.contact_owner}><{/if}> ) +<{ if $contact.contact_uid}> + <a href='<{$xoops_url}>/userinfo.php?uid=<{$contact.contact_uid}>'><{$contact.contact_name}></a> +<{ else}> + <a href='<{$contact.contact_mail}>'><{$contact.contact_name}></a><{/if}><{if !$contact.contact_uid}> (<{$contact.contact_owner}>) +<{ /if}> </td> <td class="txtcenter xo-actions"> <img class="tooltip" onclick="display_dialog(<{$contact.contact_id}>, true, true, 'slide', 'slide', 300, 700);" @@ -243,27 +247,29 @@ <tr class="odd" id="mod_<{$contact.contact_id}>"> <td class="bold"><a class="tooltip" title="<{$smarty.const._AM_CONTACT_VIEW}> : <{$contact.contact_subject}>" href="contact.php?op=view&id=<{$contact.contact_id}>"><{$contact.contact_subject}></a> </td> - <td class="txtcenter width10 bold"><{if $contact.contact_reply}><span class="green bold pad2"><{$smarty.const._AM_CONTACT_REPLY_HAVE}></span><{else}><span - class="red bold pad2"><{$smarty.const._AM_CONTACT_REPLY_HAVENT}></span><{/if}> + <td class="txtcenter width10 bold"> + <{if $contact.contact_reply}><img src="<{xoModuleIcons16 1.png}>" alt="<{$smarty.const._AM_CONTACT_REPLY_HAVE}>" title="<{$smarty.const._AM_CONTACT_REPLY_HAVE}>" /><{else}><img src="<{xoModuleIcons16 0.png}>" alt="<{$smarty.const._AM_CONTACT_REPLY_HAVENT}>" title="<{$smarty.const._AM_CONTACT_REPLY_HAVENT}>" /><{/if}> </td> <td class="txtcenter width10"><{$contact.contact_create}></td> <{if $use_depts}><td class="txtcenter width15 bold"><{$contact.contact_department}></td><{/if}> <td ... [truncated message content] |