Giter VIP home page Giter VIP logo

koala-framework's Introduction

Koala Framework Build Status

http://www.koala-framework.org/

open source framework for web applications and websites

Powered by Php, Zend Framework, ExtJS and MySQL.

Application Framework

Build desktop like web applications with the power of Zend Framework and ExtJS - and Koala Framework as glue that makes writing smart applications as easy as possible.

CMS

Koala Framework CMS makes building websites fun. Use and combine the components shipped with Koala and just concentrate on the design and layout of your website - you will get a AJAX based, easy to use backend for free.

koala-framework's People

Contributors

beelee avatar ben-ho avatar christopheder avatar d8ta avatar darimpulso avatar dkarnutsch avatar dstemberger avatar fraxachun avatar gregorinanovak avatar jamesricky avatar kaufmo avatar lllhuber avatar mariokemetinger avatar markushauser avatar martinrohrmoser avatar mennoxx avatar mfsepplive avatar michiherbst avatar mifreudenthaler avatar mike-tuxedo avatar mirhagk avatar nsams avatar paha77 avatar qrakhen avatar rabengraph avatar schreglmann avatar vaniw avatar vividedin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

koala-framework's Issues

Setup will install twice in 3.3

because ./update file doesn't get written anymore.
Need to find a replacement.

  • check database?
  • write other file?
  • write something in config.local.ini?

Support running web in a subfolder

  • in Php always use route->assemble
  • generate controller url using route->assemble
    • in js some placeholder that calls this logic
    • in Acl?
  • replace {assets} in css and js with /prefix/assets
  • add prefix in Kwf_Component_Data, Kwf_Media

Windows compatibility

At the moment Koala Framework doesn't run properly on windows because of a few minor issues. Mainly related to path handling.

Cache problem when changing startpage in pagetree

How: Change the startpage in pagetree
Problem: There is still the old Url on the lightbox when you have an ImageEnlarge for example
Example: Skoda Octavia Specialsite
Temporary solution: clear ViewCache

What happened with TINYINT mysql type?

Hi!

In 3.5 all works well, but in 3.7 or 3.8:

exception 'Kwf_Exception' with message 'Column "pos" must not be of type TINYINT in table "employeeStaffRoles"' in C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Model\Db.php:63
Stack trace:
#0 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Model\Db.php(1421): Kwf_Model_Db->getColumnType('pos')
#1 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Model\Db\Row.php(45): Kwf_Model_Db->convertValueType('pos', '1')
#2 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Field\MultiFields.php(216): Kwf_Model_Db_Row->__get('pos')
#3 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Field\Abstract.php(156): Kwf_Form_Field_MultiFields->load(Object(Row_Employee), Array)
#4 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Container\Abstract.php(161): Kwf_Form_Field_Abstract->load(Object(Row_Employee), Array)
#5 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Field\Abstract.php(156): Kwf_Form_Container_Abstract->load(Object(Row_Employee), Array)
#6 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Container\Abstract.php(161): Kwf_Form_Field_Abstract->load(Object(Row_Employee), Array)
#7 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Field\Abstract.php(156): Kwf_Form_Container_Abstract->load(Object(Row_Employee), Array)
#8 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Form\Container\Abstract.php(161): Kwf_Form_Field_Abstract->load(Object(Row_Employee), Array)
#9 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Controller\Action\Auto\Form.php(97): Kwf_Form_Container_Abstract->load(NULL)
#10 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Auto_Form->jsonLoadAction()
#11 C:\OpenServer\domains\aviashelf1\library\zend\1.10.7\Zend\Controller\Dispatcher\Standard.php(295): Kwf_Controller_Action->dispatch('jsonLoadAction')
#12 C:\OpenServer\domains\aviashelf1\library\zend\1.10.7\Zend\Controller\Front.php(953): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#13 C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Controller\Front.php(142): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Http), Object(Kwf_Controller_Response_Http))
#14 C:\OpenServer\domains\aviashelf1\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#15 {main}

It's a basic type. What's wrong with it?

I had to switch all data types from TINYINT to SMALLINT but in standard KWF tables you still using the TINYINT. I don't understand =))

No clear-cache changing contentWidth

Problem: no clear cache on changing a Component.php
When you changing the ContentWidth in the Root_Component it is still the same when the CCW is running.

Limit the user log to one month

Hi!

In my app logs stored since the release app in production in table 'kwf_user_messages'. How can I limit this DB rows to one month?

"WARNING: > untagged" on login form

Hi!

Currently "WARNING: > untagged" appears on login form.
Could you please make displaying this notification optional to be able to configure it?

Thank you.

Strange exception in js log console

Hi,

Just found strange exception in js console:

"Uncaught TypeError: Cannot call method 'insertBefore' of null"

See it anytime I try to load any controller.

But nothing critical in behaviour.

Feature request: pass row or record id into _initFields()

It would be really useful if I have row instance or record id in the AutoForm _initFields() as a parameter to be able to add fields depending on current data.

For example to set some fields to ShowField depending on some record cell's data (state).

"Error - wrong version" loop problem

Hi!

KWF 3.8 has a "error - wrong version" loop problem.

See:
wrong

Only one way to solve this problem - clear browser cache (or Ctrl + F5 but doesn't always help).

For example, if I change bootstrap.php in root dir (with text "site unavailable now") and change to normal after works - this dialog shows to all users and I go to clean them browser cache =) In general, this error occurs after any changes in the files of my application

Button "OK" reload page and error shows again.

Login page customization

Hi!

Lost-password.tpl needs title (or special master template)
If I my title looks like <title>sometext - <?php echo $this->applicationName; ?></title> in master.tpl then only sometext - shows in lost password page...

Some questions:

  • Line 22 in login.tpl: formField($this->form) ?> Where I can find and edit form template? Something wrong with translate and "e-mail" in my translation has line-break =(
  • Line 12 in login.tpl: image) { ?> How to specify my image/logo to this?
  • Line 7 in master.tpl: favicon) { ?> Why favicon does not load? After login it shows normally.

cache forms: Implement viewCache=ask

Add support for a component setting:
viewCache = ask
that dynamically calls a static method in the component to ask if the view cache should be used.

Kwc_Form can implement that and return true if no parameters where submitted and so the default form without any loaded values will be shown.

Implementation detail:
add {viewCacheAsk} before the cache entry itself so we know that we have to ask.

Firefox eats memory and CPU with opened Firebug console

Hi!

I use latest Firefox (36.0.1) and Firebug (2.0.8) and recently began to notice the browser freezes with opened Firebug console (F12).
Memory 500 mb, CPU 25% - 10-15 seconds the process is not responding. Bug in chrome://firebug/content/lib/trace.js:36
This happened in every page refresh in both server OS: Windows and Linux. If you close FB console - problem disappear.

Non-KWF projects works well.

Firefox overflow scrolls problem

Hi!

If height of the form is less than height of all elements in it, a horizontal and vertical scrolls shows. In 3.5 ONLY vertical scroll shows.
I increase height and most of problems is gone.

eg call:

$this->_editDialog = array(
                                       'controllerUrl' => '/flightplans/flightfile',
                                       'width' => 550,
                                       'height' => 270  <--- this value must be more than height of all elements on form
                                       );

eg. adding field:

$this->_form->add(new Kwf_Form_Field_Select('typeId', trlKwf('Type')))
        ->setValues($typeModel)
        ->setSelect($typeSelect)
        ->setWidth(400)
        ->setAllowBlank(false);

But one problem is solved only by comment set of width line.
It exists also in version 3.5.

See:
3 5_edit_dropdown_bug
Scrolls not shows, but part of dropdown is hidden.

In 3.8 it looks like:
3 8_edit_dropdown_bug

eg.:

$positions = new Kwf_Form_Field_Select('positionId', trlKwf('Position'));
        $positions->setValues($typeModel->getRows($typeSelect));
        $positions->setAllowBlank(false);
        $positions->setWidth(400);

I created a small testcase based on kwf-app-demo to show you this bug:
https://github.com/Sogl/kwf-app-demo
Just click on edit dialog in FF.

And also I found why the most scrolls problem happened...

Scrolls shows only in Firefox, see:

.ext2-gecko .x2-window-body .x2-form-item {
    overflow: auto;
}

Every form item has this class and (overflow: auto) fires on each and adds scrolls. Please fix it =)

Can't install everywhere =(

Copy fromoriginal here: https://groups.google.com/forum/#!topic/koala-framework-dev/YyAHvExheNw

Hello, Koala framework developers!

I'm trying to install Koala Framework, but it not work. 4 days of debugging and no results at all...
2 days in windows platform. 2 days on linux platform....NOTHING

I use one instruction for all manipulations:
http://www.koala-framework.org/documentation/installation/local_php_built-in_webserver

Windows:

os 8.1 x64
lamp - openServer (apache 2.2.26, php 5.4.22, mysql 5.5.35, mod_rewrite on, apc on).

1. kwf-cms-demo

First, I try to install cms. I cloned git and saw installation wizard, but DB not create, because has i syntax error in setup.sql - extra semicolon. After correcting this DB install normally. Also in setup was a mistake about the locale, but I have not found how to fix it. I see this after all. Is it normal work? looks like html without any css...see file 1.jpg
1

No errors in folder kwf-cms-demo\log

2. kwf-app-demo

Second, I try to install app. On install i saw error "cache_dir must be a directory"... 2 hours of debug file cache/baskend/file.php, setting 'C:\temp\cache' etc and found a solution - ("cache_dir must be a directory" . echo $value). Value was 'cache\trl'. After create folder 'trl' installation comlete (same mistake about locale). But finally app not work, freeze on stage "loading..." see 2.jpg
2

In kwf-app-demo\log\notfound same in 2 files:

** REQUEST_URI **
/members/json-data
-- REQUEST_URI --

** HTTP_REFERER **
http://kwf-app-demo/
-- HTTP_REFERER --

** Time **
05:23:43
-- Time --

In kwf-app-demo\log\error same in 2 files:

** Exception **
Kwf_Exception_JavaScript
-- Exception --

** Thrown **
:
-- Thrown --

** Message **
"Uncaught SyntaxError: Unexpected token <"
-- Message --

** stack **

-- stack --

** REQUEST_URI **
http://kwf-app-demo/
-- REQUEST_URI --

** HTTP_REFERER **
(none)
-- HTTP_REFERER --

** HTTP_USER_AGENT **
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
-- HTTP_USER_AGENT --

** User **
guest
-- User --

** Time **
05:23:43
-- Time --

In all my attempts to clear cache I saw error - Fatal error: Call to undefined function mb_internal_encoding() in C:\OpenServer
domains\kwf-cms-demo\cache\setup3.php on line 51
BUT extension=php_mbstring.dll ENABLED(!), I see it in my phpinfo....

after disabling this line, next error:

exception 'Zend_Db_Adapter_Exception' with message 'The mysql driver is not curr
ently installed' in C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend
Db\Adapter\Pdo\Abstract.php:112
Stack trace:
_0 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Db\Adapter\Pdo\My
sql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
_1 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Db\Adapter\Abstra
ct.php(448): Zend_Db_Adapter_Pdo_Mysql->_connect()
_2 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Db\Adapter\Pdo\Ab
stract.php(238): Zend_Db_Adapter_Abstract->query('SHOW TABLES', Array)
_3 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Db\Adapter\Abstra
ct.php(765): Zend_Db_Adapter_Pdo_Abstract->query('SHOW TABLES', Array)
_4 C:\OpenServer\domains\kwf-cms-demo\kwf-lib\Kwf\Util\ClearCache.php(127): Zend
_Db_Adapter_Abstract->fetchCol('SHOW TABLES')
_5 C:\OpenServer\domains\kwf-cms-demo\kwf-lib\Kwf\Controller\Action\Cli\ClearCac
heController.php(68): Kwf_Util_ClearCache->getTypes()
_6 [internal function]: Kwf_Controller_Action_Cli_ClearCacheController::getHelpO
ptions()
_7 C:\OpenServer\domains\kwf-cms-demo\kwf-lib\Kwf\Controller\Action\Cli\Abstract
.php(16): call_user_func(Array)
_8 C:\OpenServer\domains\kwf-cms-demo\kwf-lib\Kwf\Controller\Action.php(21): Kwf
_Controller_Action_Cli_Abstract->preDispatch()
_9 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Controller\Dispat
cher\Standard.php(295): Kwf_Controller_Action->dispatch('indexAction')
_10 C:\OpenServer\domains\kwf-cms-demo\library\zend\1.10.7\Zend\Controller\Front
.php(953): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_R
equest_Cli), Object(Kwf_Controller_Response_Http))
_11 C:\OpenServer\domains\kwf-cms-demo\kwf-lib\Kwf\Controller\Front.php(142): Ze
nd_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Con
troller_Response_Http))
_12 C:\OpenServer\domains\kwf-cms-demo\bootstrap.php(9): Kwf_Controller_Front->d
ispatch()
_13 {main}

BUT pdo_mysql and other dll's INSTALLED(!)

3. Working project

I tried to transfer normal working Koala project to my localhost, but see white screen.... manipulations with php/apache log level do nothing.

4. Working project GIT

I clone same project from GIT and see errors in browser:

Warning: include(Zend\Registry.php): failed to open stream: No such file or directory in C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Loader.php on line 47
Warning: include(Zend\Registry.php): failed to open stream: No such file or directory in C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Loader.php on line 47
Warning: include(): Failed opening 'Zend\Registry.php' for inclusion (include_path='.;C:\OpenServer\domains\aviashelf1\kwf-lib;library/zend/1.10.7') in C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Loader.php on line 47
Fatal error: Class 'Zend_Registry' not found in C:\OpenServer\domains\aviashelf1\kwf-lib\Kwf\Registry.php on line 3

I tried to debug this, but not see what zend wants from me, this framework very big =(

Errors, errors, errors... In Windows system totally fault....

Linux:

os ubuntu x64 14.04 server
lamp - openServer (apache 2.4.7, php 5.5.9 with zend 2.5.0 and zend OPcache v.7.0.3, mysql 5.5.38, mod_rewrite on).

I tried to download virtual machine from koala server - 404 error
http://www.koala-framework.org/vmimages/ubuntukwf.vdi.bz2

Tried to see configuration - 404 error
http://www.koala-framework.org/about/server_requirements/ubuntu_example_configuration

1. kwf-app-demo

In first attempt in Linux I tried to clone kwf-app-demo. I cloned it to /var/www/html/portal (subdirectory on virtual host), start bootstrap.php, click "setup" and saw an error about permissions.... but after chmod 755 /var/www I saw 500 Internal server error.
I delete all and do it again into /var/www/html (root directory)... 5 refresh times koala wrote me - 500 error
"http://localhost/kwf/maintenance/setup" - see 3.jpg (not found)
3

http://localhost/ show me list of files, when I choose bootstrap.php - 500 error (after 3-5 calls/refresh from browser). See 4.jpg
4

In /var/www/html/log/error in 2 files:

** Exception **
ErrorException
-- Exception --

** Thrown **
/var/www/html/kwf-lib/Kwf/Setup.php:169
-- Thrown --

** Message **
Undefined index: REDIRECT_URL
-- Message --

** ExceptionDetail **
exception 'ErrorException' with message 'Undefined index: REDIRECT_URL' in /var/www/html/kwf-lib/Kwf/Setup.php:169
Stack trace:
#0 /var/www/html/kwf-lib/Kwf/Setup.php(169): Kwf_Debug::handleError(8, 'Undefined index...', '/var/www/html/k...', 169, Array)

_1 /var/www/html/kwf-lib/Kwf/Setup.php(298): Kwf_Setup::getRequestPath()
_2 /var/www/html/bootstrap.php(5): Kwf_Setup::dispatchMedia()
_3 {main}
-- ExceptionDetail --

** REQUEST_URI **
/bootstrap.php
-- REQUEST_URI --

** HTTP_REFERER **
h/ttp://192.168.1.147/
-- HTTP_REFERER --

** User **
guest
-- User --

** Time **
01:56:16
-- Time --

** _USERAGENT **
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
-- _USERAGENT --

** _GET **
Array
(
)

-- _GET --

** _POST **
Array
(
)

-- _POST --

** SERVER **
Array
(
[HTTP_HOST] => 192.168.1.147
[HTTP_CONNECTION] => keep-alive
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,
/_;q=0.8
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
[HTTP_REFERER] => h/ttp://192.168.1.147/
[HTTP_ACCEPT_ENCODING] => gzip,deflate,sdch
[HTTP_ACCEPT_LANGUAGE] => ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
[PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[SERVER_SIGNATURE] =>

Apache/2.4.7 (Ubuntu) Server at 192.168.1.147 Port 80

[SERVER_SOFTWARE] => Apache/2.4.7 (Ubuntu)
[SERVER_NAME] => 192.168.1.147
[SERVER_ADDR] => 192.168.1.147
[SERVER_PORT] => 80
[REMOTE_ADDR] => 192.168.1.9
[DOCUMENT_ROOT] => /var/www/html
[REQUEST_SCHEME] => http
[CONTEXT_PREFIX] => 
[CONTEXT_DOCUMENT_ROOT] => /var/www/html
[SERVER_ADMIN] => webmaster@localhost
[SCRIPT_FILENAME] => /var/www/html/bootstrap.php
[REMOTE_PORT] => 51175
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => 
[REQUEST_URI] => /bootstrap.php
[SCRIPT_NAME] => /bootstrap.php
[PHP_SELF] => /bootstrap.php
[REQUEST_TIME_FLOAT] => 1412207776.577
[REQUEST_TIME] => 1412207776

)

-- _SERVER --

** _FILES **
Array
(
)

-- _FILES --

Looks like mod_rewrite not work....

Today 5th day of debugging... arrrrrgh....

_Dear developers, what I'm doing wrond? How to make this wonder work??? =))_

Double Login Bug

if not logged in (because session expired) and two parallel requests are sent you'll get two login windows.

Expected behaviour:
only one login window shoud appear and the requests should queue somehow

'composer update' issues

Hi!

Today I tried to update KWF by 'composer update' and it fails:

c:\OpenServer\domains\aviashelf>composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing mouf/nodejs-installer (v1.0.0)
    Downloading: 100%

  - Updating koala-framework/composer-extra-assets (v1.0.1 => v1.1.0)
    Checking out 4860eb4c7041824559962a0fc1a3b139fc501444

  - Installing psr/log (1.0.0)
    Downloading: 100%

  - Installing monolog/monolog (1.13.1)
    Downloading: 100%

  - Installing symfony/finder (v2.6.5)
    Downloading: 100%

  - Installing symfony/event-dispatcher (v2.6.5)
    Downloading: 100%

  - Installing koala-framework/file-watcher (dev-master 16ca00a)
    Cloning 16ca00a1b7cdac053a1760b45a5385d31b1bc278

  - Installing symfony/console (v2.6.5)
    Downloading: 100%

  - Updating koala-framework/kwf-modernizr 3.8.x-dev (0e62ee2 => 51f4f70)
    Checking out 51f4f707413a74d371866e50b275f7317e0ac8d9

  - Updating koala-framework/koala-framework 3.8.x-dev (c9cdd71 => b1959d9)
    Checking out b1959d98fadb06f46d2e555106bfe2f3d41b394b

monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/event-dispatcher suggests installing symfony/http-kernel ()
Writing lock file
Generating autoload files

installing npm dependencies in 'C:\OpenServer\domains\aviashelf/vendor/koala-framework/kwf-modernizr'...

installing npm dependencies in 'C:\OpenServer\domains\aviashelf/vendor/koala-framework/koala-framework'...
[email protected] node_modules\amdlc
тФФтФАтФА [email protected] ([email protected], [email protected], [email protected], [email protected])

installing bower dependencies...
bower tinymce#4.1.9         not-cached git://github.com/tinymce/tinymce.git#4.1.9
bower tinymce#4.1.9            resolve git://github.com/tinymce/tinymce.git#4.1.9
bower tinymce#4.1.9           download https://github.com/tinymce/tinymce/archive/4.1.9.tar.gz
bower tinymce#4.1.9           progress received 0.6MB
bower tinymce#4.1.9           progress received 0.6MB
bower tinymce#4.1.9           progress received 0.7MB
bower tinymce#4.1.9            extract archive.tar.gz
bower tinymce#4.1.9       invalid-meta tinymce is missing "main" entry in bower.json
bower tinymce#4.1.9       invalid-meta tinymce is missing "ignore" entry in bower.json
bower tinymce#4.1.9           resolved git://github.com/tinymce/tinymce.git#4.1.9
bower tinymce#4.1.9            install tinymce#4.1.9

tinymce#4.1.9 vendor\bower_components\tinymce

c:\OpenServer\domains\aviashelf>php bootstrap.php clear-cache
[ 1/10] clearing simpleCache... OK (11ms)
[ 2/10] clearing model......... OK (15ms)
[ 3/10] clearing simple........ OK (70ms)
[ 4/10] clearing twig.......... OK (1ms)
[ 5/10] clearing zend.......... OK (1ms)
[ 6/10] clearing config........ OK (1ms)
[ 7/10] clearing setup......... OK (0ms)
[ 8/10] clearing assets........ OK (10ms)
[9/10] refreshing config...... OK (28ms)
[10/10] refreshing setup....... OK (148ms)

c:\OpenServer\domains\aviashelf>php bootstrap.php build
[ 1/3] building trl...... OK (56ms)
[ 2/3] building events... OK (92ms)
[ 3/3] building assets...
calculating dependencies...
 75% [################-----] Maintenance js                                    exception 'Kwf_Exception' with message 'Can't find dependency 'KwfTinyMce'' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php:37
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('ExtHtmlEditIniD...')
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(46): Kwf_Assets_ProviderList_Abstract->findDependency('ExtHtmlEditIniD...')
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('ExtHtmlEdit')
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(35): Kwf_Assets_ProviderList_Abstract->findDependency('ExtHtmlEdit')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('KwfWelcomeIniDe...')
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(46): Kwf_Assets_ProviderList_Abstract->findDependency('KwfWelcomeIniDe...')
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('KwfWelcome')
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(35): Kwf_Assets_ProviderList_Abstract->findDependency('KwfWelcome')
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('KwfCoreIniDep')
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(46): Kwf_Assets_ProviderList_Abstract->findDependency('KwfCoreIniDep')
#10 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('KwfCore')
#11 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(35): Kwf_Assets_ProviderList_Abstract->findDependency('KwfCore')
#12 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('MaintenanceIniD...')
#13 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Provider\Ini.php(46): Kwf_Assets_ProviderList_Abstract->findDependency('MaintenanceIniD...')
#14 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\ProviderList\Abstract.php(83): Kwf_Assets_Provider_Ini->getDependency('Maintenance')
#15 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Package.php(28): Kwf_Assets_ProviderList_Abstract->findDependency('Maintenance')
#16 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Package.php(81): Kwf_Assets_Package->getDependency()
#17 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Assets\Package.php(75): Kwf_Assets_Package->_getFilteredUniqueDependencies('text/javascript')
#18 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Build\Types\Assets.php(140): Kwf_Assets_Package->getFilteredUniqueDependencies('text/javascript')
#19 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Build\Types\Abstract.php(15): Kwf_Util_Build_Types_Assets->_build(Array)
#20 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Build.php(97): Kwf_Util_Build_Types_Abstract->build(Array)
#21 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\Cli\BuildController.php(35): Kwf_Util_Build->build(Array)
#22 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Cli_BuildController->indexAction()
#23 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#24 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#25 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(140): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#26 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#27 {main} [ERROR] (1057ms)

xls to xlsx migration

Hi!

Why KWF still uses oldschool format *.xls (excel 2003) with PHPExcel library? Are there some difficulties in the transition to the new format?

In my own extended classes I rewrite writer from Excel5 to Excel2007 and everything works fine.

Not a complete translation

Hi!
I use RU translation, but it not full. I did full RU translation pull request before.

  1. Delete dialog.
    kwf-lib/trl.xml has yes/no translation to RU, but shows me EN.
    See:
    delete
  2. "Loading..." text in controllers.
    First time shows me translated version, second and other times - EN version.
    See:
    loading
  3. Filtering.
    See:
    filter
  4. Pagination.
    See:
    pagination
  5. Calendar.
    See:
    calendar
    Also it would be nice to change first day of the week.

P.S.
I found file related to translation problem (pagination):
\vendor\koala-framework\koala-framework\extjs2\src\widgets\PagingToolbar.js

if I change values to needed lang - all is OK.

Also I found why it happened (maybe). I use webCodeLanguage = ru, but file with translations has 'en' prefix:
\vendor\koala-framework\koala-framework\Ext\ext-lang-en.js

That's why in previous version all be OK. webCodeLanguage was en in 3.5.
I think I need ext-lang-ru.js file.
Is it right?

problem adding page as pagetype

You have to clear the cache manually if you create a pagetype in config.ini:
kwc.childComponents.Kwc_Root_Category_Component.home = Home_Component

same happens if you delete one.

clear-cache-watcher: Incorrect detecting APC

Hi!

KWF incorrectly detects APC I think. It's not the first time I faced a problem.

This shows after clear WAMP installing (portable version, no APC at all):

MODIFY C:/OpenServer/domains/aviashelf/views/user/login.tpl
finished in 0.84ms

MODIFY C:/OpenServer/domains/aviashelf/config.ini
removed config cache
APC: error:  http://aviashelf/kwf/util/apc/clear-cache <br />
<b>Fatal error</b>:  Call to undefined function apc_delete() in <b>C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Apc.php</b> on line <b>181</b><br />
<html>
    <head>
        <title>500 Internal Server Error</title>
    </head>
    <body>
        <h1>Error</h1>

                    Errortype:<br />
            <pre></pre>

            <br />

            Message:<br />
            <pre>exception 'ErrorException' with message 'Call to undefined function apc_delete()' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Apc.php:181
Stack trace:
#0 [internal function]: Kwf_Setup::shutDown()
#1 {main}</pre>
                                    <p id="exception" style="display:none">czoyNDU6ImV4Y2VwdGlvbiAnRXJyb3JFeGNlcHRpb24nIHdpdGggbWVzc2FnZSAnQ2FsbCB0byB1bmRlZmluZWQgZnVuY3Rpb24gYXBjX2RlbGV0ZSgpJyBpbiBDOlxPcGVuU2VydmVyXGRvbWFpbnNcYXZpYXNoZWxmXHZlbmRvclxrb2FsYS1mcmFtZXdvcmtca29hbGEtZnJhbWV3b3JrXEt3ZlxVdGlsXEFwYy5waHA6MTgxClN0YWNrIHRyYWNlOgojMCBbaW50ZXJuYWwgZnVuY3Rpb25dOiBLd2ZfU2V0dXA6OnNodXREb3duKCkKIzEge21haW59Ijs=</p>            </body>
</html>


cleared apc config cache
cleared setup.php cache
handled event in 684.58ms
finished in 685.07ms

Line in php_errors.log on Linux machine (APCu installed):

[16-Feb-2015 11:51:14 Asia/Sakhalin] PHP Fatal error:  Call to undefined function apc_clear_cache() in /var/www/puls/vendor/koala-framework/koala-framework/Kwf/Util/Apc.php on line 196

Can't update DB schema from 3.5 to 3.8 (much pain bug)

Hi!

I am still facing the consequences of improper schemes (many bugs) and the inability to go with standard command.

If I use "php bootstrap.php update":

c:\OpenServer\domains\aviashelf>php bootstrap.php update
exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_update' doesn't exist' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:228
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php(228): PDOStatement->execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Update\Helper.php(206): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\Cli\Web\UpdateController.php(53): Kwf_Util_Update_Helper::getExecutedUpdatesNames()
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Cli_Web_UpdateController->indexAction()
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#9 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#10 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#11 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'portal2.kwf_update' doesn't exist, query was: UPDATE kwf_update SET data=?' in C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement\Pdo.php:235
Stack trace:
#0 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Statement.php(323): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#3 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Util\Update\Helper.php(206): Zend_Db_Adapter_Pdo_Abstract->query('UPDATE kwf_upda...', 'a:8:{i:0;s:16:"...')
#4 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action\Cli\Web\UpdateController.php(53): Kwf_Util_Update_Helper::getExecutedUpdatesNames()
#5 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Action.php(33): Kwf_Controller_Action_Cli_Web_UpdateController->indexAction()
#6 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php(308): Kwf_Controller_Action->dispatch('indexAction')
#7 C:\OpenServer\domains\aviashelf\vendor\koala-framework\zendframework1\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#8 C:\OpenServer\domains\aviashelf\vendor\koala-framework\koala-framework\Kwf\Controller\Front.php(139): Zend_Controller_Front->dispatch(Object(Kwf_Controller_Request_Cli), Object(Kwf_Controller_Response_Http))
#9 C:\OpenServer\domains\aviashelf\bootstrap.php(20): Kwf_Controller_Front->dispatch()
#10 {main}

If I add this table by hands from kwf-app-demo (without data) and do same update command:

c:\OpenServer\domains\aviashelf>php bootstrap.php update
No update revision found, assuming up-to-date

What next? What data can I put into 'kwf_update' to update schema from 3.5 to 3.8 correctly? Now I copy tables and fields to my DB in case of errors.

p.s.
I looked which tables (kwc and kwf) I have:

  • kwc_fulltext_meta
  • kwf_log_duplicate
  • kwf_pools
  • kwf_redirects
  • kwf_uploads
  • kwf_users
  • kwf_user_messages
  • kwf_welcome
  • kwf_sessions (now added by hands to work with memcache)

That's all. But in kwf-app-demo are more of them, including those which are due to errors.

How to call json-xls from custom dropdown

Hi!

I want to create dropdown menu with these things:

  1. Click to dropdown menu creates modal dialog. Modal dialog contains two dates and button OK.
  2. Button OK send dates to 'json-xls' (excel export)
  3. Custom excel template per menu item. Data loads to selected excel-file.

First step I want only to call standart 'json-xls' from my view:

var Exceluploads = Ext2.extend(Ext2.Panel, {
    timeout: 300000,

    initComponent : function(test) {

        var employeeWorks = new Kwf.Auto.GridPanel({
            controllerUrl   : '/exceluploads/exceluploads',
            region          : 'center',
            height          : 600,
            resizable       : true,
            split           : true,
            title           : trl('Данные по сотрудникам'),
            gridConfig: {
                tbar: [
                    //'->',
                    {
                        text:'Выгрузки',
                        icon: '/assets/silkicons/page_excel.png',
                        cls: 'x2-btn-text-icon',
                        menu: [{
                            text:'Выгрузка EXXON',
                            icon: '/assets/silkicons/page_excel.png',
                            cls: 'x2-btn-text-icon',
                            handler : this.onXls
                        },{
                            text:'Выгрузка SEIC',
                            icon: '/assets/silkicons/page_excel.png',
                            cls: 'x2-btn-text-icon',
                            handler : this.onXls
                        }
                        ]
                    },
                ]
            }
        });

        var grid = new Kwf.Auto.GridPanel({
            controllerUrl   : '/exceluploads/months',
            region          : 'west',
            width           : 200,
            resizable       : true,
            split           : true,
            collapsible     : true,
            bindings: [{
                        queryParam: 'workId',
                        item: employeeWorks
                      }],
            title           : trlKwf('Calendar'),
        });

       this.layout = 'border';
       this.items = [grid, {
                     layout: 'border',
                     region: 'center',
                     items: [employeeWorks]
                     }];
        Exceluploads.superclass.initComponent.call(this);
    },

    onXls : function() {
        var params = Kwf.clone(this.getStore().baseParams);
        if(this.getStore().sortInfo){
            var pn = this.getStore().paramNames;
            params[pn["sort"]] = this.getStore().sortInfo.field;
            params[pn["dir"]] = this.getStore().sortInfo.direction;
        }

        Ext2.Ajax.request({
            url : this.controllerUrl+'/json-xls',
            params  : params,
            timeout: 600000, // 10 minuten
            progress: true,
            progressTitle : trlKwf('Excel export'),
            success: function(response, opt, r) {
                var downloadUrl = this.controllerUrl+'/download-export-file?downloadkey='+r.downloadkey;
                for (var i in params) {
                    downloadUrl += '&' + i + '=' + params[i];
                }
                if (Ext2.isIE) {
                    Ext2.Msg.show({
                        title: trlKwf('Your download is ready'),
                        msg: trlKwf('Please click on the following link to download your Excel file.')
                            +'<br /><br />'
                            +'<a class="xlsExportLink" href="'+downloadUrl+'" target="_blank">'
                            +trlKwf('Excel export file')+'</a>',
                        icon: Ext2.Msg.INFO,
                        buttons: { ok: trlKwf('Close') }
                    });
                } else {
                    Ext2.getBody().createChild({
                        html: '<iframe width="0" height="0" src="'+downloadUrl+'"></iframe>'
                    });
                }
            },
            scope: this
        });
    }

});

Now I see error:

TypeError: this.getStore is not a function
...},onXls:function(){var params=Kwf.clone(this.getStore().baseParams);if(this.getS...

As I understand, I need to also migrate this function...
I chose the right way to implement? May have an easier way?

How it looks now:
tbar2

Scroll up after changes in table (problem)

Hi!

KWF output a huge table with many columns, scroll of this table is very large. Users edit lines with button 'edit' and after that scroll rises up. It brings a lot of discomfort for re-scroll to find the desired line.

How to fix this?
For example, how to remember the position of the scroll (or number of edit line) and send it after reloading/rerendering?

Who is online

Hi!

How can I implement "who is online" function? I want to see what users now connected to my app.

PHPExcel is requred library (errors)

Hi!

Standard Excel-grid unloading not works with adding phpexcel library:

Fatal error: Class 'PHPExcel' not found in /var/www/puls/vendor/koala-framework/koala-framework/Kwf/Controller/Action/Auto/Grid.php on line 931

Line 931:

$xls = new PHPExcel();

My composer:

{
    "require": {
         "koala-framework/koala-framework": "3.8.x-dev",
      "phpoffice/phpexcel": "1.8.0"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Library exists in vendor folder. Library string also exists in autoload_namespaces.php file.

You can simply check this issue by adding this line to IndexController.php of kwf-app-demo:

$xls = new PHPExcel();

p.s. Now my Excel unloadings works only with old KWF 3.5 line in config.ini:

externLibraryPath.phpexcel = ./vendor/phpoffice/phpexcel/Classes

add installer script

things this script should do:

  • query for db config
  • query for library path
  • execute check-config
  • do what setup does now

LDAP-auth implementation

Hi!

Can you help me implement LDAP authentification with Active Directory to KWF?
For my another project I used AdLDAP library:
http://adldap.sourceforge.net/

I think it was some steps:

  1. User type LDAP login and pass.
  2. KWF send it to LDAP and check user in group and attribute with role name.
  3. If user with right login/pass and step 2 conditions exists, KWF create new one (for log and other statistics).
  4. User log in to app.
    Maybe need drop-down menu of the type of authentication (sql-users and AD). Or just copy password and other attributes and put it to 'kwf_users' table

Right?

Code from my class:

<?php

namespace Auth;

    //we need adldap library 
    require_once($_SERVER['DOCUMENT_ROOT'].'/adLDAPCore/adLDAP.php');

class User
{

    public $adldap;
    //domain conf
    private $ad_accsuff = "@contoso.com";
    private $ad_basedn = "DC=contoso,DC=com";
    private $ad_dc = array("contoso.com");

    //I put user role for web-app in domain attribute (eg extensionattribute1, because it's always empty)
    private $ad_role_attribute = 'extensionattribute1';
    //in what group user must be (access control)
    private $ad_site_group = 'Group';

    //I use it for download default user photo
    //private $path_photo = $_SERVER['DOCUMENT_ROOT'] . '/css/';


    private $is_authorized = false;
    public $in_group = true;

    //creator
    public function __construct($server)
    {
        //if we use AD auth
        if ($server == 'ad') {
            $this->connectAd($this->ad_accsuff, $this->ad_basedn, $this->ad_dc);
        }
    }

    //connect func
    public function connectAd($ad_accsuff, $ad_basedn, $ad_dc)
    {
        $this->adldap = new \adLDAP(array(
            'account_suffix' => $ad_accsuff, 
            'base_dn' => $ad_basedn, 
            'domain_controllers' => $ad_dc
        ));

        return $this;
    } 

    //auth func
    public function authorizeAd($username, $password)
    {   
        //try to auth
        $auth = $this->adldap->authenticate($username, $password);

        //something wrong (bad username/pass)
        if (!$auth) {
            //noooooo!
            return false;
        }

        //try to check user in group
        $inwebgroup = $this->adldap->user()->inGroup($username, $this->ad_site_group);

        //if not in group (login/pass is correct)
        if (!$inwebgroup) {
            //sorry, permission denied =(
            return $this->in_group = false;         
        }

        //get user attributes in array
        $this->user = $this->adldap->user()->info($username,  array('thumbnailphoto' ,'objectguid', 'sn', 'givenname', $this->ad_role_attribute));

        //guid (unique ad id)
        $guid =  $this->user[0]['objectguid'][0];
        //firstname
        $firstname = $this->user[0]['givenname'][0];
        //lastname
        $lastname = $this->user[0]['sn'][0];
        //user role from extensionattribute1
        $role = $this->user[0][$this->ad_role_attribute][0];
        //get thumbnail photo (96 x 96 max dimension)
        $photo = $this->user[0]['thumbnailphoto'][0];

        //guid to normal string     
        $guid = $this->guid_to_string($guid);

        //temp file operations
        $tempFile = tempnam(sys_get_temp_dir(), 'img');
        file_put_contents($tempFile, $photo);
        $finfo = new \finfo(FILEINFO_MIME_TYPE);
        $mime  = explode(';', $finfo->file($tempFile));
        //to base64
        $photo_base64 = 'data:' . $mime[0] . ';base64,' . base64_encode($photo);

        //fill user array with data
        $this->user = array (
            'id' => $guid,
            'fullname' => $lastname . ' ' .  $firstname,
            'role' => $role,
            'photo' => $photo_base64
        );

        //woohoo, life is good
        $this->is_authorized=true;

        //yeah, return true
        return $this->is_authorized;
    }

    //use for check in my web-app
    public static function isAuthorized()
    {
        if (!empty($_SESSION["user_id"])) {
            return (bool) $_SESSION["user_id"];
        }
        return false;
    }

    //I use for clear session 
    public function logout()
    {
        if (!empty($_SESSION["user_id"])) {
            unset($_SESSION["user_id"]);
            unset($_SESSION["role"]);
            unset($_SESSION["fullusername"]);
            unset($_SESSION["photo"]);
        }
    }

    //guid to string func
    public function guid_to_string( $guid )
    {
        $hex_guid = unpack( "H*hex", $guid );
        $hex    = $hex_guid["hex"];

        $hex1   = substr( $hex, -26, 2 ) . substr( $hex, -28, 2 ) . substr( $hex, -30, 2 ) . substr( $hex, -32, 2 );
        $hex2   = substr( $hex, -22, 2 ) . substr( $hex, -24, 2 );
        $hex3   = substr( $hex, -18, 2 ) . substr( $hex, -20, 2 );
        $hex4   = substr( $hex, -16, 4 );
        $hex5   = substr( $hex, -12, 12 );

        $guid = $hex1 . "-" . $hex2 . "-" . $hex3 . "-" . $hex4 . "-" . $hex5;

        return $guid;
    }

}

Kwc_User_Activate for frontend does not work

Doesn't work in 3.7 because success=true is returned for ajax-request.
In 3.4 ajax-request also failed but success=false is returned so it worked.

Ajax request failing because "code" parameter isn't sent but set as url-param so post does work.

Possible fix:
forward "code" param from get-Params in hiddenfield "config" via getTemplateVars

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.