Esempio n. 1
0
 function init()
 {
     parent::init();
     $this->addField('dattm', ___('Payment Date'))->setGetFunction(function ($record, $grid, $field) {
         return amDatetime($record->dattm);
     });
     $this->addField('display_invoice_id', ___('Receipt ID'));
     $this->addField('name', ___('Consumer Name'));
     $this->addField('email', ___('Consumer Email'));
     $this->addField('country', ___('Country'));
     $this->addField('address', ___('Address'))->setGetFunction(function ($record, $grid, $field) {
         return join(", ", array($record->street, $record->city, $record->zip, $record->state, $record->country));
     });
     $this->addField('inv_ip', ___('IP(Country)'))->setGetFunction(function ($record, $grid, $field) {
         return $record->inv_ip . "(" . ($record->inv_ip_country ? $record->inv_ip_country : ___('undefined')) . ")";
     });
     $this->addField('reg_ip', ___('Registration IP(Country)'))->setGetFunction(function ($record, $grid, $field) {
         return $record->reg_ip . "(" . ($record->reg_ip_country ? $record->reg_ip_country : ___('undefined')) . ")";
     });
     $this->addField('self_country', ___('Confirmed Manually'));
     $this->addField('tax_id', ___('VAT ID'));
     $this->totals[] = $this->addField('total_amount', ___('Amount excl. Tax'));
     $this->totals[] = $this->addField('tax_amount', ___('VAT'));
     $this->addField('tax_rate', ___('VAT Rate'))->setGetFunction(function ($record, $grid, $field) {
         return $record->{$field} ? $record->{$field} . "%" : "-";
     });
     $this->setFilter(new Am_Grid_Filter_EU_VAT_Details());
 }
Esempio n. 2
0
 public function _format($d)
 {
     if (trim($d) == '') {
         return '';
     }
     switch ($this->format) {
         case self::DATE:
             return amDate($d);
         case self::TIME:
             return amTime($d);
         default:
             return amDatetime($d);
     }
 }
Esempio n. 3
0
 public function _format($d)
 {
     if (trim($d) == '') {
         return '';
     }
     if ($d == Am_Period::MAX_SQL_DATE) {
         return ___('Lifetime');
     }
     switch ($this->format) {
         case self::DATE:
             return amDate($d);
         case self::TIME:
             return amTime($d);
         default:
             return amDatetime($d);
     }
 }
    function indexAction()
    {
        check_demo();
        $this->view->title = ___('Version Info');
        $trial = "";
        if ('==TRIAL==' != '==' . 'TRIAL==') {
            $trial = "Trial Version (expires ==TRIAL_EXPIRES==)";
        }
        if ('==LITE==' != '==' . 'LITE==') {
            $trial = "<b>LITE Version</b>";
        }
        $am_version = AM_VERSION;
        $zend_version = Zend_Version::VERSION;
        $cron_last_run = Am_Cron::getLastRun() ? amDatetime(Am_Cron::getLastRun()) : ___('Never');
        $cron_last_run_title = ___('Cron Last Run');
        $now = amDatetime('now');
        $now_title = ___('Current Server Date and Time');
        $timezone = date_default_timezone_get();
        $timezone_title = ___('Server Timezone');
        $phpversion = phpversion() . " (" . php_sapi_name() . ")";
        $os = substr(php_uname(), 0, 28);
        if (strlen($os) == 28) {
            $os = "{$os}...";
        }
        $mysql = $this->getDi()->db->selectCell("SELECT VERSION()");
        $db = $this->getDi()->getParameter('db');
        $dsn = sprintf("mysql://%s@%s:%d/%s.%s", $db['mysql']['user'], $db['mysql']['host'], $db['mysql']['port'] ? $db['mysql']['port'] : 3306, $db['mysql']['db'], $db['mysql']['prefix']);
        $root = ROOT_DIR;
        $root_title = ___('Root Folder');
        $modules = array();
        foreach ($this->getDi()->modules->getEnabled() as $m) {
            $fn = APPLICATION_PATH . '/' . $m . '/module.xml';
            if (!file_exists($fn)) {
                continue;
            }
            $xml = simplexml_load_file($fn);
            if (!$xml) {
                continue;
            }
            $version = "(" . $xml->version . ")";
            $modules[] = "{$m} {$version}";
        }
        $modules = join("<br />", $modules);
        $modules_title = ___('Modules');
        $plugins = "";
        foreach (array_merge($this->getDi()->plugins_payment->loadEnabled()->getAllEnabled(), $this->getDi()->plugins_protect->loadEnabled()->getAllEnabled()) as $p) {
            $rClass = new ReflectionClass(get_class($p));
            $plugins .= sprintf("%s (%s - %s) <br />\n", $p->getId(), preg_replace('/\\$' . 'Revision: (\\d+).*/', '$1', $rClass->getConstant('PLUGIN_REVISION')), preg_replace('/\\$' . 'Date: (.+?)\\s+.+/', '$1', $rClass->getConstant('PLUGIN_DATE')));
        }
        $plugins_title = ___('Plugins');
        $_ = explode('_', get_class($this->getDi()->cacheBackend));
        $cacheBackend = array_pop($_);
        $cacheBackend_title = ___('Cache Backend');
        $version_title = ___('Software version info');
        $amInfo = <<<CUT
<div class="grid-container">
<table class="grid">
<tr>
    <th colspan="2">{$version_title}</th>
</tr>
<tr>
    <td align="right">{$now_title}</td>
    <td><strong>{$now}</strong></td>
</tr>
<tr>
    <td align="right">{$timezone_title}</td>
    <td><strong>{$timezone}</strong></td>
</tr>
<tr>
    <td align="right">aMember</td>
    <td><strong>{$am_version}</strong>
    {$trial}
    </td>
</tr>
<tr class="odd">
    <td align="right">Zend Framework</td>
    <td><strong>{$zend_version}</strong></td>
</tr>
<tr>
    <td align="right">PHP</td>
    <td><strong>{$phpversion}</strong></td>
</tr>
<tr class="odd">
    <td align="right">OS</td>
    <td><strong>{$os}</strong></td>
</tr>
<tr>
    <td align="right" rowspan="2">MySQL</td>
    <td><strong>{$mysql}</strong></td>
</tr>
<tr>
    <td><strong>{$dsn}</strong></td>
</tr>
<tr class="odd">
    <td align="right">{$cacheBackend_title}</td>
    <td><strong>{$cacheBackend}</strong></td>
</tr>
<tr>
    <td align="right">{$root_title}</td>
    <td><strong>{$root}</strong></td>
</tr>
<tr class="odd">
    <td align="right">{$cron_last_run_title}</td>
    <td><strong>{$cron_last_run}</strong></td>
</tr>
<tr>
    <td align="right">{$modules_title}</td>
    <td>{$modules}</td>
</tr>
<tr class="odd">
    <td align="right">{$plugins_title}</td>
    <td>{$plugins}</td>
</tr>
</table>
</div>
<br /><br />
CUT;
        ob_start();
        phpinfo(1 | 4 | 8 | 16 | 32);
        $phpInfo = ob_get_clean();
        $phpStyles = <<<CUT
#phpinfo {background-color: #ffffff; color: #000000;}
#phpinfo td, #phpinfo th, #phpinfo h1, #phpinfo h2 {font-family: sans-serif;}
#phpinfo pre {margin: 0px; font-family: monospace;}
#phpinfo a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
#phpinfo a:hover {text-decoration: underline;}
#phpinfo table {border-collapse: collapse;}
#phpinfo .center {text-align: center;}
#phpinfo .center table { margin-left: auto; margin-right: auto; text-align: left;}
#phpinfo .center th { text-align: center !important; }
#phpinfo td, #phpinfo th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
#phpinfo h1 {font-size: 150%;}
#phpinfo h2 {font-size: 125%;}
#phpinfo .p {text-align: left;}
#phpinfo .e {background-color: #ccccff; font-weight: bold; color: #000000;}
#phpinfo .h {background-color: #9999cc; font-weight: bold; color: #000000;}
#phpinfo .v {background-color: #cccccc; color: #000000;}
#phpinfo .vr {background-color: #cccccc; text-align: right; color: #000000;}
#phpinfo img {float: right; border: 0px;}
#phpinfo hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
CUT;
        preg_match('/<body>(.*)<\\/body>/s', $phpInfo, $matches);
        $phpInfo = $matches[1];
        $content = sprintf('<style type="text/css">%s</style>%s<h1>PHP info</h1><div id="phpinfo" class="grid-container"><br />%s</div>', $phpStyles, $amInfo, $phpInfo);
        $this->view->assign('content', $content);
        $this->view->display("admin/layout.phtml");
    }
 function renderTimestamp($record, $field)
 {
     $val = $record->{$field};
     if ($val) {
         $val = amDatetime($val);
     } else {
         $val = 'Not Sent';
     }
     return sprintf('<td>%s</td>', $val);
 }
Esempio n. 6
0
 public function renderTime($record, $fieldName)
 {
     return sprintf('<td><time title="%s" datetime="%s">%s</time></td>', amDatetime($record->{$fieldName}), date('c', amstrtotime($record->{$fieldName})), $this->getView()->getElapsedTime($record->{$fieldName}));
 }
Esempio n. 7
0
    public function onGridUserInitForm(Am_Event_Grid $event)
    {
        $fieldSet = $event->getGrid()->getForm()->addAdvFieldset('affiliate')->setLabel(___('Affiliate Program'));
        $user = $event->getGrid()->getRecord();
        $user_id = $user->pk();
        $affGroup = $fieldSet->addGroup()->setLabel(___('Referred Affiliate'));
        $affEl = $affGroup->addText('_aff', array('placeholder' => ___('Type Username or E-Mail')))->setId('aff-refered-affiliate');
        $fieldSet->addScript()->setScript(<<<CUT
    \$("input#aff-refered-affiliate").autocomplete({
        minLength: 2,
        source: window.rootUrl + "/aff/admin/autocomplete/?exclude={$user_id}"
    });
CUT
);
        if (!empty($user->aff_id)) {
            try {
                $aff = $this->getDi()->userTable->load($user->aff_id);
                $affEl->setValue($aff->login);
                $affEl->setAttribute('style', 'display:none');
                $url = new Am_View_Helper_UserUrl();
                $is_expired = false;
                if ($commissionDays = $this->getDi()->config->get('aff.commission_days')) {
                    $signupDays = $this->getDi()->time - strtotime($user->aff_added ? $user->aff_added : $user->added);
                    $signupDays = intval($signupDays / (3600 * 24));
                    // to days
                    if ($commissionDays < $signupDays) {
                        $is_expired = true;
                    }
                }
                $affHtml = sprintf('<div><a class="link" href="%s">%s %s (%s)</a> [<a href="javascript:;" title="%s" class="local" id="aff-unassign-affiliate">x</a>]%s</div>', Am_Controller::escape($url->userUrl($user->aff_id)), $aff->name_f, $aff->name_l, $aff->email, ___('Unassign Affiliate'), $is_expired ? sprintf('<div class="red">%s</div>', ___('affiliate <-> user relation is expired (%saccording your settings%s <strong>User-Affiliate Relation Lifetime</strong> is %d day(s)), no commissions will be added for new payments', '<a href="' . REL_ROOT_URL . '/admin-setup/aff">', '</a>', $commissionDays)) : '');
                $affGroup->addStatic()->setContent($affHtml);
                $affGroup->addScript()->setScript(<<<CUT
\$('#aff-unassign-affiliate').click(function(){
    \$(this).closest('div').remove();
    \$('#aff-refered-affiliate').val('');
    \$('#aff-refered-affiliate').show();
})
CUT
);
            } catch (Am_Exception $e) {
                // ignore if affiliate was deleted
            }
        }
        if ($user->isLoaded() && ($source = $user->data()->get('aff-source'))) {
            preg_match('/^([a-z]*)(-(.*))?$/i', $source, $match);
            $res = '';
            switch ($match[1]) {
                case 'ip':
                    $res = ___('Assigned by IP <strong>%s</strong> at %s', $match[3], amDatetime($user->aff_added));
                    break;
                case 'cookie':
                    $res = ___('Assigned by COOKIE at %s', amDatetime($user->aff_added));
                    break;
                case 'admin':
                    $admin = $this->getDi()->adminTable->load($match[3], false);
                    $res = ___('Assigned by Administrator <strong>%s</strong> at %s', $admin ? sprintf('%s (%s %s)', $admin->login, $admin->name_f, $admin->name_l) : '#' . $match[3], amDatetime($user->aff_added));
                    break;
                case 'coupon':
                    $res = ___('Assigned by Coupon %s at %s', '<a href="' . REL_ROOT_URL . '/admin-coupons?_coupon_filter=' . urlencode($match[3]) . '">' . $match[3] . '</a>', amDatetime($user->aff_added));
                    break;
                case 'invoice':
                    $invoice = $this->getDi()->invoiceTable->load($match[3], false);
                    $res = ___('Assigned by Invoice %s at %s', $invoice ? '<a href="' . REL_ROOT_URL . '/admin-user-payments/index/user_id/' . $invoice->user_id . '#invoice-' . $invoice->pk() . '">' . $invoice->pk() . '/' . $invoice->public_id . '</a>' : '<strong>#' . $match[3] . '</strong>', amDatetime($user->aff_added));
                    break;
                default:
                    $res = $source;
            }
            $fieldSet->addHtml()->setLabel(___('Affiliate Source'))->setHtml('<div>' . $res . '</div>');
        }
        $fieldSet->addElement('advradio', 'is_affiliate')->setLabel(___("Is Affiliate?\n" . 'customer / affiliate status'))->loadOptions(array('0' => ___('No'), '1' => ___('Both Affiliate and member'), '2' => ___('Only Affiliate %s(rarely used)%s', '<em>', '</em>')))->setValue($this->getConfig('signup_type') == 1 ? 1 : 0);
        if ($cr = $this->getConfig('custom_redirect')) {
            $fieldSet->addElement('advradio', 'aff_custom_redirect')->setLabel(___('Allow Affiliate to redirect Referrers to any url'))->loadOptions(array('0' => $cr == self::AFF_CUSTOM_REDIRECT_ALLOW_SOME_DENY_OTHERS ? ___('No') : ___('Yes'), '1' => $cr == self::AFF_CUSTOM_REDIRECT_DENY_SOME_ALLOW_OTHERS ? ___('No') : ___('Yes')));
        }
        $this->addPayoutInputs($fieldSet);
    }
 function renderLoginAt(Admin $a)
 {
     return $this->renderTd($a->last_login ? $a->last_ip . ___(' at ') . amDatetime($a->last_login) : null);
 }
Esempio n. 9
0
 public function render()
 {
     $invoice = $this->invoice;
     $pdf = $this->createPdfTemplate();
     $padd = 20;
     $left = $padd;
     $right = $this->getPaperWidth() - $padd;
     $fontH = $this->getFontRegular();
     $fontHB = $this->getFontBold();
     $styleBold = array('font' => array('face' => $fontHB, 'size' => 12));
     $page = new Am_Pdf_Page_Decorator($pdf->pages[0]);
     $page->setFont($fontH, 12);
     $pointer = $this->getPointer();
     $pointerL = $pointerR = $pointer;
     $page->drawText('Invoice Number: ' . $invoice->public_id, $left, $pointerL);
     $page->nl($pointerL);
     $page->drawText('Date: ' . amDatetime($invoice->tm_added), $left, $pointerL);
     $page->nl($pointerL);
     $page->setFont($fontHB, 12);
     $page->drawText($invoice->getName(), $right, $pointerR, null, Am_Pdf_Page_Decorator::ALIGN_RIGHT);
     $page->setFont($fontH, 12);
     $page->nl($pointerR);
     $page->drawText($invoice->getEmail(), $right, $pointerR, null, Am_Pdf_Page_Decorator::ALIGN_RIGHT);
     $page->nl($pointerR);
     $page->drawText('', $right, $pointerR, null, Am_Pdf_Page_Decorator::ALIGN_RIGHT);
     $page->nl($pointerR);
     $page->drawText(implode(', ', array_filter(array($invoice->getStreet(), $invoice->getCity()))), $right, $pointerR, null, Am_Pdf_Page_Decorator::ALIGN_RIGHT);
     $page->nl($pointerR);
     $page->drawText(implode(', ', array_filter(array($this->getState($invoice), $invoice->getZip(), $this->getCountry($invoice)))), $right, $pointerR, null, Am_Pdf_Page_Decorator::ALIGN_RIGHT);
     $page->nl($pointerR);
     $pointer = min($pointerR, $pointerL);
     $page->nl($pointer);
     $table = new Am_Pdf_Table();
     $table->setMargin($padd, $padd, $padd, $padd);
     $table->setStyleForRow(1, array('shape' => array('type' => Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, 'color' => new Zend_Pdf_Color_Html("#cccccc")), 'font' => array('face' => $fontHB, 'size' => 12)));
     $table->setStyleForColumn(2, array('align' => 'right', 'width' => 80));
     $table->addRow(array(___('Subscription/Product Title'), ___('Price')));
     foreach ($invoice->getItems() as $p) {
         $table->addRow(array($p->item_title, $invoice->getCurrency($p->getFirstSubtotal())));
     }
     $table->addRow(array(___('Subtotal'), $invoice->getCurrency($invoice->first_subtotal)))->addStyle($styleBold);
     if ($invoice->first_discount > 0) {
         $table->addRow(array(___('Coupon Discount'), $invoice->getCurrency($invoice->first_discount)));
     }
     if ($invoice->first_tax > 0) {
         $table->addRow(array(___('Tax Amount'), $invoice->getCurrency($invoice->first_tax)));
     }
     $table->addRow(array(___('Total'), $invoice->getCurrency($invoice->first_total)))->addStyle($styleBold);
     $pointer = $page->drawTable($table, 0, $pointer);
     $page->nl($pointer);
     $termsText = new Am_TermsText($invoice);
     $page->drawTextWithFixedWidth(___('Subscription Terms') . ': ' . $termsText, $left, $pointer, $this->getPaperWidth() - 2 * $padd);
     $page->nl($pointer);
     if (!$this->getDi()->config->get('invoice_custom_template') || !$this->getDi()->uploadTable->load($this->getDi()->config->get('invoice_custom_template'))) {
         if ($ifn = $this->getDi()->config->get('invoice_footer_note')) {
             $page->nl($pointer);
             $page->drawTextWithFixedWidth($ifn, $left, $pointer, $this->getPaperWidth() - 2 * $padd);
         }
     }
     return $pdf->render();
 }
 function getLastSigninInfo($obj, $controller, $field = null)
 {
     return $obj->last_login ? $obj->last_ip . ___(' at ') . amDatetime($obj->last_login) : ___('Never');
 }
 public function getUsedCount($obj)
 {
     $invoices = Am_Di::getInstance()->invoiceTable->findByCouponId($obj->coupon_id);
     if (!$invoices) {
         return '';
     }
     $ret = array();
     $out = '';
     $wrap = '<strong>' . ___('Transactions with this coupon:') . '</strong>' . '<div><table class="grid">' . '<tr><th>' . ___('User') . '</th><th>' . ___('Invoice') . '</th><th>' . ___('Date/Time') . '</th><th>' . ___('Receipt#') . '</th><th>' . ___('Amount') . '</th><th>' . ___('Discount') . '</th></tr>' . '%s</table></div>';
     $tpl = '<tr><td>%s (%s %s)</td><td>%d/%s</td><td>%s</td><td>%s</td><td>%s</td><td><strong>%s</strong></td></tr>';
     foreach ($invoices as $invoice) {
         if ($invoice->getStatus() == Invoice::PENDING) {
             continue;
         }
         $payments = $this->getDi()->invoicePaymentTable->findBy(array('invoice_id' => $invoice->invoice_id, 'discount' => '<>0'), null, null, "invoice_payment_id");
         foreach ($payments as $payment) {
             $user = Am_Di::getInstance()->userTable->load($payment->user_id);
             $ret[] = sprintf($tpl, $this->getDi()->view->escape($user->login), $this->getDi()->view->escape($user->name_f), $this->getDi()->view->escape($user->name_l), $invoice->pk(), $invoice->public_id, amDatetime($payment->dattm), $this->getDi()->view->escape($payment->receipt_id), $this->getDi()->view->escape(Am_Currency::render($payment->amount)), $this->getDi()->view->escape(Am_Currency::render($payment->discount)));
         }
         //100% discount
         if (!$payments) {
             try {
                 $user = Am_Di::getInstance()->userTable->load($invoice->user_id);
                 $ret[] = sprintf($tpl, $this->getDi()->view->escape($user->login), $this->getDi()->view->escape($user->name_f), $this->getDi()->view->escape($user->name_l), $invoice->pk(), $invoice->public_id, amDatetime($invoice->tm_started), '&ndash;', $this->getDi()->view->escape(Am_Currency::render(0)), ___('100% discount'));
             } catch (Am_Exception_Db_NotFound $e) {
                 $this->getDi()->errorLogTable->logException($e);
             }
         }
     }
     $out .= implode("\n", $ret);
     return $out ? sprintf($wrap, $out) : $out;
 }
 public function notConfirmedAction()
 {
     $arr = array();
     foreach ($this->getDi()->db->select("SELECT `blob_value`, expires FROM ?_store \n            WHERE name LIKE 'signup_record-%' AND CHAR_LENGTH(blob_value)>10") as $row) {
         $v = unserialize($row['blob_value']);
         $rec = array();
         foreach ($v['values'] as $page) {
             $rec = array_merge($rec, $page);
         }
         $rec['expires'] = amDatetime($row['expires']);
         $link = Am_Controller::escape($v['opaque']['ConfirmUrl']);
         $rec['link'] = 'Give this link to customer if e-mail confirmation has not been received:' . '<br /><br /><pre>' . $link . '</pre><br />';
         if (empty($rec['login'])) {
             $rec['login'] = null;
         }
         if (empty($rec['name_f'])) {
             $rec['name_f'] = null;
         }
         if (empty($rec['name_l'])) {
             $rec['name_l'] = null;
         }
         $arr[] = (object) $rec;
     }
     $ds = new Am_Grid_DataSource_Array($arr);
     $grid = new Am_Grid_Editable('_usernc', ___("Not Confirmed Users"), $ds, $this->_request, $this->view, $this->getDi());
     $grid->addField('login', ___('Username'));
     $grid->addField('email', ___('E-Mail'));
     $grid->addField('name_f', ___('First Name'));
     $grid->addField('name_l', ___('Last Name'));
     $grid->addField('expires', ___('Expires'));
     $grid->addField(new Am_Grid_Field_Expandable('link', ___('Link')))->setEscape(false);
     $grid->actionsClear();
     $this->view->content = $grid->runWithLayout('admin/layout.phtml');
 }
 function renderLoginIndicator(Am_Record $rec)
 {
     $res = $rec->last_login ? '<span style="background:#FFFFCF; color:#454430; padding:0.2em 0.5em; font-size:80%; border-radius:5px;">' . amDatetime($rec->last_login) . '<span>' : '<span style="background:#BA2727; color: white; padding:0.2em 0.5em; font-size:80%; border-radius:5px;">' . ___('Never') . '</span>';
     if ($rec->login_session_cnt) {
         $res = '<span style="background:#488f37; color: white; padding:0.2em 0.5em; font-size:80%; border-radius:5px;">' . ___('Online') . ($rec->login_session_cnt > 1 ? sprintf(' (%d)', $rec->login_session_cnt) : '') . '</span>';
     }
     return sprintf('<td>%s</td>', $res);
 }
Esempio n. 14
0
    function getWarnings()
    {
        $warn = array();
        $setupUrl = REL_ROOT_URL . "/admin-setup";
        $rootUrl = REL_ROOT_URL;
        if (!$this->getDi()->config->get('maintenance')) {
            // cron run
            $t = Am_Cron::getLastRun();
            $diff = time() - $t;
            $tt = $t ? ___('at ') . amDatetime($t) : ___('NEVER (oops! no records that it has been running at all!)');
            if ($diff > 24 * 3600 && APPLICATION_ENV != 'demo') {
                $warn[] = ___('Cron job has been running last time %s, it is more than 24 hours before.
Most possible external cron job has been set incorrectly. It may cause very serious problems with the script.
You can find info how to set up cron job for your installation <a class="link" href="http://www.amember.com/docs/Cron" target="_blank">here</a>.', $tt);
            }
        }
        ////
        if (!$this->getDi()->productTable->count()) {
            $warn[] = ___('You have not added any products, your signup forms will not work until you <a class="link" href="' . $rootUrl . '/admin-products">add at least one product</a>');
        }
        // Check for not approved users.
        if ($this->getDi()->config->get('manually_approve')) {
            $na_users = $this->getDi()->db->selectCell('select count(*) from ?_user where is_approved<1');
            if ($na_users) {
                $warn[] = sprintf(___('Number of users who require approval: %d. %sClick here%s to review these users.'), $na_users, '<a class="link" href="' . REL_ROOT_URL . '/admin-users?_u_search[field-is_approved][val]=0">', '</a>');
            }
        }
        // Check for not approved invoices.
        if ($this->getDi()->config->get('manually_approve_invoice')) {
            $na_invoices = $this->getDi()->db->selectCell('select count(*) from ?_invoice where status=?', Invoice::NOT_CONFIRMED);
            if ($na_invoices) {
                $warn[] = sprintf(___('Number of invoices which require approval: %d. %sClick here%s to review these invoices.'), $na_invoices, '<a class="link" href="' . REL_ROOT_URL . '/default/admin-payments/p/not-approved/index">', '</a>');
            }
        }
        if ($this->getDi()->config->get('email_queue_enabled') && !$this->getDi()->config->get('use_cron')) {
            $warn[] = ___('%sEnable%s and %sconfigure%s external cron if you are using E-Mail Throttle Queue', '<a class="link" href="' . REL_ROOT_URL . '/admin-setup/advanced">', '</a>', '<a class="link" href="http://www.amember.com/docs/Cron">', '</a>');
        }
        if ($this->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_email_template WHERE name in (?a)", array('pending_to_user', 'pending_to_admin', 'expire', 'autoresponder')) && !$this->getDi()->config->get('use_cron')) {
            $warn[] = ___('%sEnable%s and %sconfigure%s external cron if you are using Periodic E-Mails (Autoresponder/Expiration/Pending Notifications)', '<a class="link" href="' . REL_ROOT_URL . '/admin-setup/advanced">', '</a>', '<a class="link" href="http://www.amember.com/docs/Cron">', '</a>');
        }
        // load all plugins
        try {
            foreach ($this->getDi()->plugins as $m) {
                $m->loadEnabled();
            }
        } catch (Exception $e) {
        }
        $event = $this->getDi()->hook->call(Am_Event::ADMIN_WARNINGS);
        $warn = array_merge($warn, $event->getReturn());
        // return
        return $warn;
    }