Attached is a nice article on understanding input filter validation in php. Are we going to use them in FA?
5,001 09/24/2014 11:48:01 am
Topic: Is FA going to use php filters (0 replies, posted in FA Modifications)
5,002 09/24/2014 11:09:49 am
Re: How to make a report in FA? (Newbie) (1 replies, posted in Reporting)
Use the standard functions in the */includes/db/*.inc files or roll your own in your module and include them in the report. If such SQLs are going to be used exclusively in the specific report only, make the wrapper function in the report itself or use it inline.
Study the existing reporting/repXXX.php files and the variable input form parameters file reporting/reports_main.php.
If you wish to have your own class of reports (Reports and Analysis Menu), then append it to the first stanza in reporting/includes/reports_classes.inc:
// Standard report classess
define('RC_CUSTOMER', 0);
define('RC_SUPPLIER', 1);
define('RC_INVENTORY', 2);
define('RC_MANUFACTURE', 3);
define('RC_DIMENSIONS', 4);
define('RC_BANKING', 5);
define('RC_GL', 6);
define('RC_PAYROLL',7); // <------ Added now5,003 09/24/2014 10:59:43 am
Re: Sales quotation with images (4 replies, posted in Reporting)
Any config.php flag to switch it on / off?
/* for uploaded item pictures */
$pic_width = 80;
$pic_height = 50;
$max_image_size = 500;Whilst the units for the width/height is clearly understood as pixels, the image_size is in Kb or just bytes?
A comment in the report to indicate setting width/height in the config.php would be useful.
5,004 09/24/2014 04:58:09 am
Re: Primary Development Repo from mid May 2013 - Git (17 replies, posted in Announcements)
Which URL works?
5,005 09/24/2014 04:55:35 am
Re: FA Website visitors - India leads (4 replies, posted in Translations)
Thanks Joe. The number of downloads since 1st May 2014 (FA v2.3.21 was released in May 2014) shows the US, India and Indonesia leading in that order quite closely but the rest of the world is less than 50% of the lowest of these.
This info should be useful for consultants to offer their services in virgin territories.....or position themselves where the fish are.
5,006 09/23/2014 06:19:58 pm
Topic: Change menu_entry.png in standard themes (0 replies, posted in FA Modifications)
WEBROOT=/var/www/frontac
WORKDIR=`pwd`
cd ${WEBROOT}/
wget http://www.apmuthu.com/files/menu_entry.png
# mkdir -p themes/{aqua,cool,default}/images
echo themes/{aqua,cool,default}/images/ | xargs -n 1 cp -f menu_entry.png
rm -f menu_entry.png
cd ${WORKDIR}
WEBROOT=
WORKDIR=This will make for a clearer Add icon.
5,007 09/23/2014 05:37:38 pm
Re: FA Website visitors - India leads (4 replies, posted in Translations)
It is possible that all .com, .net and .org hostnames are assumed to be from US in AWStats. The sitestats I had put up was for pages that had google analytics / ads in them and relied on GeoIP for source determination. Surprised that Kenya does not figure in the stats between India and Canada. Try updating the GeoIP in AWStats if it is used.
Actually, I find quite a lot of enquiries for FA in India recently and wondered how it grew. "Tally" is the leading brand of Accounting software here in India but customers are getting fed up with the licence activation system now that their servers seem to be getting virus and power related breakdowns frequently. Many are now looking for a skin to ape the Tally look and feel to reduce the learning curve.
I have not run a single commercial install of FA till date and have only supported others installs and that too not in India. FA has been more of an example project to convince wannahaves of the maturity of Open Source.
I would like some repo site stats too to be published - that would be more on the usage side.
Maybe we need a General Topic on the FA Forum.
5,008 09/23/2014 02:33:51 pm
Topic: FA Website visitors - India leads (4 replies, posted in Translations)
India, Kenya and Canadian IPs seem to be the biggest visitors according to Google Analytics.
5,009 09/23/2014 10:09:23 am
Re: I can't post payment transaction by cash with negative balance (2 replies, posted in Banking and General Ledger)
Wiki-ed it.
5,010 09/23/2014 09:16:51 am
Re: Primary Development Repo from mid May 2013 - Git (17 replies, posted in Announcements)
5,011 09/23/2014 09:12:23 am
Re: $next_extension_id elimination (2 replies, posted in FA Modifications)
The extension id can be unique if it is parsed from the max value of the id in the array and not from the array count.
When an extension is removed (after de-activation from all domains), will these security parameters too be removed from the security_roles tables and be available for re-use?
Is there any list of security area_identifiers across all official extensions to prevent unintended re-use across ones from different authors?
5,012 09/23/2014 08:55:37 am
Re: Git clone from official repository (10 replies, posted in Installation)
The browseable url is:
http://devel.frontaccounting.com/git/?p=fa-stable.git
Hope the said port 9418 is open for such cloning.
The IP reverse resolves to my.frontaccounting.com
To troubleshoot, the PortScan will be handy:
<Scan>
<Info>PortScan</Info>
<Host>176.31.120.126
<Hostname>my.frontaccounting.com</Hostname>
<OpenPort>SSH [22]</OpenPort>
<OpenPort>SMTP [25]</OpenPort>
<SMTPServer>220 ks395322.kimsufi.com ESMTP Postfix (Debian/GNU)</SMTPServer>
<OpenPort>HTTP [80]</OpenPort><OpenPort>imap [143]</OpenPort>
<IMAPServer>[CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.</IMAPServer>
<OpenPort>587</OpenPort>
<HTTPServer>Apache/2.2.16 (Debian)</HTTPServer>
<HTTPTitle>400 Bad Request</HTTPTitle>
</Host>
</Scan>5,013 09/23/2014 05:38:01 am
Re: Local Repo (9 replies, posted in Modules Add-on's)
The latency from here to your host at both www.garrapato.com and the repo subdomain are about 330 to 350 ms and that may not be an issue as I've worked with far slower ones.
Please delete gz files in the modules/_cache folder and then try again. The code does not bother to retrieve the gz files afresh and relies on existing ones even if their sha1sum is different if they exist locally (YMMV).
Also request how / which file you made as Release.sig.
The automation scripts placed in the farepo folder (permissions 700, execute as ./getrelease) for creating the various gz files are:
Filename: getconfigs
#!/bin/sh
# Use with
# find ./2.3/extensions/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip > Extensions.gz
tar xOzf $1 _init/config | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' &&
echo -n SHA1sum: &&
sha1sum $1 | cut -d" " -f1 &&
echoFilename: getrelease
#!/bin/sh
SRCDIR=./2.3/
RELFILE=${SRCDIR}Release
find ${SRCDIR}extensions/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Extensions.gz
find ${SRCDIR}charts/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Charts.gz
find ${SRCDIR}languages/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Languages.gz
find ${SRCDIR}themes/ -type f -name *.pkg -exec ./getconfigs \{\} \; | gzip -f > ${SRCDIR}Themes.gz
echo Path: charts > ${RELFILE}
echo Type: chart >> ${RELFILE}
echo Filename: Charts.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Charts.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: extensions >> ${RELFILE}
echo Type: extension >> ${RELFILE}
echo Filename: Extensions.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Extensions.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: languages >> ${RELFILE}
echo Type: language >> ${RELFILE}
echo Filename: Languages.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Languages.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
echo Path: themes >> ${RELFILE}
echo Type: theme >> ${RELFILE}
echo Filename: Themes.gz >> ${RELFILE}
echo Version: 2.3 >> ${RELFILE}
echo SHA1sum: `sha1sum ${SRCDIR}Themes.gz | cut -d" " -f1` >> ${RELFILE}
echo >> ${RELFILE}
gzip -f ${RELFILE}5,014 09/22/2014 05:09:24 pm
Re: Negative Stock (10 replies, posted in Report Bugs here)
Fixes needed for negative stock to work and other cosmetic changes:
File: includes/db/sql_functions.inc
Fix: missing end of file closing php tag "?>"
File: inventory/transfers.php
Fix: Change line 79 from:
global $Refs;
to
global $Refs, $SysPrefs;
File: sales/includes/ui/sales_order_ui.inc
Fix: Remove Line 138:
global $SysPrefs;'
as it is no longer needed.
****** All these issues and others have been addressed in the subsequent commit. *******
5,015 09/22/2014 05:01:19 pm
Re: Git clone from official repository (10 replies, posted in Installation)
Have you tried Hg2Git mirrorring?
http://stackoverflow.com/questions/1389307/convert-a-mercurial-repository-to-git
https://github.com/vitaly/hg2git
http://repo.or.cz/w/hg2git.git
http://blog.appveyor.com/2014/02/23/converting-mercurial-repository-to-git-on-windows/
http://arr.gr/blog/2011/10/bitbucket-converting-hg-repositories-to-git/
5,016 09/22/2014 04:55:46 pm
Re: Local Repo (9 replies, posted in Modules Add-on's)
I deactivated the cfdi extension for the Sandbox and then tried to delete the cfdi pkg in vain. It appears that there may be some openssl issue in verification. Try to bypass the signed pkg requirement in the first post in this thread and see if that is the problem.
Also please list the steps taken to make the Release.sig file so I can replicate here.
To the extent possible try to avoid using htaccess file and place it's contents in the apache conf directly with no overrides.
5,017 09/22/2014 02:59:31 pm
Topic: extension active attribute false instead of 0 (0 replies, posted in Report Bugs here)
In the files admin/inst_module.php (line 42) and includes/packages.inc (line 518), the extensions array element 'active' is assigned as false instead of 0.
During normal usage, the installed_extensions.php files toggle it between 0 and 1 and it is never set as true anywhere. Is this the desired functionality - boolean false on install and then integer 0 / 1 during usage?
5,018 09/22/2014 02:43:19 pm
Topic: $next_extension_id elimination (2 replies, posted in FA Modifications)
$next_extension_id is stored in the {webroot}/installed_extensions.php file.
It is used in:
admin/inst_module.php
admin/db/maintenance_db.inc ---> writing to the installed_extensions file(s)
includes/packages.inc
index.php ----------------------------> set during install on CoAs
sql/alter2.3/php --------------------> updation of extension array elements
In general it is declared as a global variable from within functions and used and sometimes incremented. It is never decremented.
Actually it can be obtained by querying the $installed_extensions array and choosing to be one more than the highest key number or 1 if empty array.
This way we can make the array in each company (must make it a different name) have the same elements for the activated extensions.
Is this extension id stored in any FA table as a foreign key?
5,019 09/22/2014 02:31:25 pm
Re: Batch Import of Sales Invoices from CSV file (8 replies, posted in Accounts Receivable)
A trigger on the bespoke database to populate records in the FA db might be another way out.
5,020 09/22/2014 12:34:55 pm
Re: Packaging Extensions (1 replies, posted in Modules Add-on's)
Well here is the code to make an unsigned pkg for FA:
# Install ar command
apt-get install binutils
# ar usage - not used here
# ar rcs _data customernotes.php hooks.php
MODULENAME=customernotes-2.3.21-1
WEBROOT=/var/www/frontac
mkdir -p ${WEBROOT}/modules/_cache/${MODULENAME}
# upload the _init and extn files
cd ${WEBROOT}/modules/_cache/${MODULENAME}
tar -czf _data customernotes.php hooks.php
tar -czf ../../${MODULENAME}.pkg _init _data
rm -rf ${WEBROOT}/modules/_cache/${MODULENAME}
# download the ${WEBROOT}/modules/${MODULENAME}-2.3.21-1.pkgThe _init/config file will contain the extension description and parameters and will need to be appended to the Extensions file and compressed to Extensions.gz and placed in the repo root. The Extensions.gz's sha1sum should be placed in the Release file and compressed to Release.gz and placed in the repo root.
The _init/files can be prepared by referring the FAWiki.
5,021 09/22/2014 12:28:35 pm
Re: Force dimension entry for GL accounts (1 replies, posted in Dimensions)
You may want to set a default value for the Dimension id field in the various tables in the meanwhile.
5,022 09/22/2014 12:27:01 pm
Re: Batch Import of Sales Invoices from CSV file (8 replies, posted in Accounts Receivable)
To stay within FA, use Quick Entries or use the TextCart Extension. Otherwise:
1. Take a backup of FA
2. Post a typical entry thru the FA web interface
3. take another backup of FA
4. Compare the backups using tools like WinMerge
5. Skip the normal audit trail and logging entries and focus on the meat of the insert / updates
6. Make a template out of the insert / update sqls making the timestamp entries NOW() where appropriate (and likewise for current date)
7. Export the record variables from your manual invoice system
8. Mailmerge with the sql template created in 6
9 upload the mailmerged sql statements in a MySQL client or append them to the backup and then restore it.
10. Make sure no entries are made / changed in FA in the meanwhile.
5,023 09/22/2014 12:20:58 pm
Re: FA for Real Estate Property Management (4 replies, posted in Setup)
Upload your extension and post the link here. Code will be reviewed by the developers and packaged and placed in the official repo if working well.
5,024 09/22/2014 08:31:17 am
Re: Local Repo (9 replies, posted in Modules Add-on's)
Attempting to visit http://repo.garrapato.com/ results in a "no content here" webpage instead of prompting for a username and password. If you have set no username and password for it's access, then comment out / remove the first two array elements. It should then work.
The extensions did not download within FA but only when manually the URLs were entered in FireFox.
http://repo.garrapato.com/2.3/ seems to be password protected though.
http://repo.garrapato.com/2.3/extensions/cfdi-2.3.0-1.pkg did successfully download after providing the credentials.
http://repo.garrapato.com/2.3/extensions/zen_import-2.3.15-1.pkg also was successfully downloaded without asking for the credentials again and it is the official signed pkg.
Expect you created the Extensions.gz and Release.gz properly (since it displays only a subset including yours), otherwise enable error display and check out the SHA1sums in them if you are manually making it.
Make sure that the FA webroot has the FA.pem file if you are using any official pkgs.
Also see if the same problem arises if FA is installed in the server's webroot:
from
http://garrapato.com/sandbox/fa/
to
http://garrapato.com/
You are using latin1 charset - try utf8 / utf8-general-ci
Did you actually compile the pkgs listed in the repo? If so, please list the method you used right from key creation to pkg creation and repo updation.
5,025 09/22/2014 12:54:21 am
Topic: Packaging Extensions (1 replies, posted in Modules Add-on's)
The standard extensions, themes, languages and charts of accounts are signed by the FA devs (private key will not be divulged) and their public key is part of the FA (FA.pem) download.
The format of the extension packages (pkg) and it's distribution is based on the standard debian repo system and is slightly modified. The functions to achieve it are said to be in the archive.inc and packages.inc files in the includes folder.
A first draft attempt at placing a file with the following contents in a php file in the webroot and then attempting to build a package was tried in vain:
<?php
$path_to_root=".";
$pkgname='customernotes';
$mypkg = $pkgname . '-2.3.21-1.pkg';
include_once "./config.php";
include_once "./config_db.php";
include_once "./includes/packages.inc";
$pkg = new gzip_file("_data");
$options['prepend'] = PKG_CACHE_PATH.'/'.$pkgname.'/';
$pkg->set_options($options);
$list = Array(
"customernotes.php",
"hooks.php"
);
$pkg->add_files($list);
$pkg->create_archive();
rename('./_data', PKG_CACHE_PATH.'/'.substr(basename($filename), 0, -4).'/_data');
$pkg = new pkg_file($mypkg);
$list = Array(
"_init/*",
"_data"
);
$pkg->add_files($list);
$pkg->create_archive();
?>The aim is to create a private / public key pair and then build and sign these packages and host them in a personal repo. This way many users will be able to make extensions and distribute them at will. FA can then be made to partake of multiple repos as well. The $repo_auth if used in config.php would take precedence over the one in version.php.
The following standard code from the PHP Manual may be used to generate the PKI keys needed:
<?php
// Fill in data for the distinguished name to be used in the cert
// You must change the values of these keys to match your name and
// company, or more precisely, the name and company of the person/site
// that you are generating the certificate for.
// For SSL certificates, the commonName is usually the domain name of
// that will be using the certificate, but for S/MIME certificates,
// the commonName will be the name of the individual who will use the
// certificate.
$dn = array(
"countryName" => "UK",
"stateOrProvinceName" => "Somerset",
"localityName" => "Glastonbury",
"organizationName" => "The Brain Room Limited",
"organizationalUnitName" => "PHP Documentation Team",
"commonName" => "Wez Furlong",
"emailAddress" => "wez@example.com"
);
// Generate a new private (and public) key pair
$privkey = openssl_pkey_new();
// Generate a certificate signing request
$csr = openssl_csr_new($dn, $privkey);
// You will usually want to create a self-signed certificate at this
// point until your CA fulfills your request.
// This creates a self-signed cert that is valid for 365 days
$sscert = openssl_csr_sign($csr, null, $privkey, 365);
// Now you will want to preserve your private key, CSR and self-signed
// cert so that they can be installed into your web server, mail server
// or mail client (depending on the intended use of the certificate).
// This example shows how to get those things into variables, but you
// can also store them directly into files.
// Typically, you will send the CSR on to your CA who will then issue
// you with the "real" certificate.
openssl_csr_export($csr, $csrout) and var_dump($csrout);
openssl_x509_export($sscert, $certout) and var_dump($certout);
openssl_pkey_export($privkey, $pkeyout, "mypassword") and var_dump($pkeyout);
// Show any errors that occurred here
while (($e = openssl_error_string()) !== false) {
echo $e . "\n";
}
?> 