Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Made something useful? Share it! (Topic Closed Topic Closed) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 02 July 2013 at 5:05am | IP Logged  

While we strive to make sure that functionality available in WebMail Lite (PHP) is implemented in a way convenient for most users, some of them might want to modify the product, add a feature they need, integrate WebMail with other products they use, and so on.

We'd like all our users to know: if you've made something other people can use, please feel free to share it! Even if it's some very basic modification, it might still come in really handy for others!

You can post your modifications, or links to articles posted elsewhere, in this forum thread. Subsequently, we're going to maintain a special documentation section which will include user-contributed docs. Of course, product developers will be notified of such modifications, and if particular modification is found extremely useful it can even become a part of product itself, either as a solid feature or a plugin.
Back to Top View Igor's Profile Search for other posts by Igor
 
andlis
Newbie
Newbie


Joined: 16 October 2013
Online Status: Offline
Posts: 29
Posted: 11 February 2014 at 11:16am | IP Logged  

Can I help you with Russian translation? It seems to me, you know Russian ))) However some words in Russian look odd..
Back to Top View andlis's Profile Search for other posts by andlis
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 12 February 2014 at 3:20am | IP Logged  

Actually, our support and development center is located in Russia, so yes, we speak that language

Nonetheless, if you believe the translations are incorrect or incomplete in any way, please feel free to submit improvements, ideally via HelpDesk.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
andlis
Newbie
Newbie


Joined: 16 October 2013
Online Status: Offline
Posts: 29
Posted: 12 February 2014 at 3:28am | IP Logged  

Well, I'll do )
Back to Top View andlis's Profile Search for other posts by andlis
 
PhilE
Newbie
Newbie


Joined: 13 February 2015
Location: United Kingdom
Online Status: Offline
Posts: 1
Posted: 13 February 2015 at 7:27am | IP Logged  

I see that there is an APT repository for Webmail Lite.

I'm a CentOS user, and I've created an RPM package for v7.4.2 which I'm happy to share with the community if it would be useful to anyone. It's available in a yum repository of my own hand-rolled packages which I maintain, so if the site admins are happy for me to provide a link to either the repository or the individual Webmail RPM, please let me know.
Back to Top View PhilE's Profile Search for other posts by PhilE
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 16 February 2015 at 5:20am | IP Logged  

Hello,

We've sent you an email message on this, and we look forward to hearing from you.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 31 March 2015 at 3:33am | IP Logged  

Another breaking of the code is a fact This time it enables permanent deletion of a message, skipping the Trash.

1. Alter templates/views/Mail/MessageListItemViewModel.html
add
Code:

<img src=trash-closed.png onmouseover="this.src='trash-opened.png'" onmouseout="this.src='trash-closed.png'" data-bind="customTooltip: 'SETTINGS/COMMON_DELETE_PERM'" width=13 onclick="setTimeout(delete_permanently,100)">

before
Code:

<span class="data">


2. Find suitable images for trash icons (trash-open.png) and (trash-closed.png) and save them in the root of your installation.

3. Add localisation in the SETTINGS section of your language file:
Code:

COMMON_DELETE_PERM = "Delete permanently"
COMMON_CONFIRM_DELETE_PERM = "This message will be permanently deleted."
COMMON_DELETE_PERM_FAILED = "This message was not permanently deleted!"
COMMON_DELETE_PERM_TOUT = "This message was not permanently deleted due a server timeout."



4. Add the following code to the existing sound-notify.js file
Code:

http_perm_del=initAJAX();
function delete_permanently()
{
AfterLogicApi.showConfirmPopup(AfterLogicApi.i18n('SETTINGS/COMMON_CONFIRM_DELETE_PERM'),delete_permanently_done);
}

function delete_permanently_done(bResult)
{
if (bResult)
   {
   Message = App.MailCache.currentMessage();
   uid=Message.uid();
   Folder=App.MailCache.getCurrentFolder();
   http_perm_del.open("GET", "permanent-delete.php?folder="+encodeURIComponent(Folder.fullName())+"&uid="+uid, true);
   http_perm_del.onreadystatechange = function()
      {
      if ((http_perm_del.readyState == 4) && (http_perm_del.status == 200))
         {
         switch(http_perm_del.responseText)
            {
            case "-1":
               App.Api.showError(AfterLogicApi.i18n("SETTINGS/COMMON_DELETE_PERM_FAILED"));
               break
            case "-2":
               App.Api.showError(AfterLogicApi.i18n("SETTINGS/COMMON_DELETE_PERM_TOUT"));
               break;
            case "1":
               Message.deleted(1);
            }
         }
      }
   http_perm_del.send("");
   }
}


5. Create permanent-delete.php file in the root of your installation
Code:

<?php
extract($_GET,EXTR_SKIP);
if(!isset($folder,$uid))
   die('-1');
include('libraries/afterlogic/api.php');
$oApiUsers = \CApi::Manager('users');
$oApiIntegratorManager = \CApi::Manager('integrator');
$id=$oApiIntegratorManager->GetLogginedUserId();
if (!$id)
   die('-1');
$oAccount = $oApiUsers->GetDefaultAccount($id);
$server=$oAccount->IncomingMailServer;
$port=$oAccount->IncomingMailPort;
$user=$oAccount->IncomingMailLogin;
$pass=$oAccount->IncomingMailPassword;
$cmd_cntr=1;

$fp=@fsockopen($server,$port,$errno,$errstr,300);
if (!$fp)
   die('-1');
$res=fgets($fp,1024);
if (!strstr($res,'* OK '))
   die('-1');
$res=send_data("LOGIN $user $pass");
if (!strstr($res,($cmd_cntr-1).' OK '))
   die('-1');
$res=send_data('SELECT "'.$folder.'"');
if (!strstr($res,($cmd_cntr-1).' OK '))
   die('-1');
$res=send_data("UID STORE $uid +FLAGS.SILENT (\Deleted)");
if (!strstr($res,($cmd_cntr-1).' OK '))
   die('-1');
$res=send_data("UID EXPUNGE $uid");
if (!strstr($res,($cmd_cntr-1).' OK ')||strstr($res,' OK No messages deleted'))
   die('-1');
$res=send_data("LOGOUT\n");
echo '1';

function send_data($data)
{
global $cmd_cntr,$fp;

stream_set_timeout($fp,1);
fputs($fp,"$cmd_cntr $data\n");
$info = stream_get_meta_data($fp);
if ($info['timed_out'])
   die('-2');
$cmd_cntr++;
while(1)
   {
   $temp=fgets($fp,1024);
   if (!strstr($temp,'*'))
      {
      $resp=$temp;
      break;
      }
   }
return $resp;
}
?>


And the result lookes like this




Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 31 March 2015 at 5:15am | IP Logged  

Bravo!

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 30 April 2015 at 11:09pm | IP Logged  

Here is a little ammendment to the file permanent-delete.php. This is to support SSL enabled imap servers.
Replace
Quote:
$fp=@fsockopen($server,$port,$errno,$errstr,300);

with
Quote:
$use_ssl=$oAccount->IncomingMailUseSSL;
if (!$use_ssl)
   $fp=@fsockopen($server,$port,$errno,$errstr,300);
else
   {
   $streamContext = stream_context_create();
   stream_context_set_option($streamContext, 'ssl', 'local_cert', ' ');
   $fp = stream_socket_client('ssl://'.$server.':'.$port, $error, $errorString, 2,
   STREAM_CLIENT_CONNECT, $streamContext);
   }
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 01 May 2015 at 1:31am | IP Logged  

Thanks for the continued contribution! We'll need to find a way to publish this in our documentation somehow - going to be tricky since it's not a plugin, but we'll find that way eventually :)

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 01 May 2015 at 8:57am | IP Logged  

Igor wrote:
We'll need to find a way to publish this in our documentation somehow - going to be tricky since it's not a plugin, but we'll find that way eventually :)

Well, if you could provide a way to hook to the HTML templates by means of your API, it might as well become a plugin.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6103
Posted: 01 May 2015 at 1:05pm | IP Logged  

I believe that one is available in JavaScript API, and there's a couple of examples where the approach is used, here and here - or you need something more complex than just including the template?

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 01 May 2015 at 11:02pm | IP Logged  

I mean modifying (inserting code in) an existing template, not creating a new one (adding tabs to settings and menu screens).
Like, for example, I modified the MessageListItemViewModel.html template, but not by hand.
Anyway, I will play around with getElementsByClassName and appendChild, and see what happens.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 03 May 2015 at 6:16am | IP Logged  

There is a light at the end of the tunnel, and hopefully it's not the oncoming train.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 
webdbase2
Valued Community Member
Valued Community Member


Joined: 25 March 2015
Location: Bulgaria
Online Status: Offline
Posts: 81
Posted: 03 May 2015 at 10:49am | IP Logged  

OK, the permanent deletion plugin is a fact. I'll describe it in a new post.
Back to Top View webdbase2's Profile Search for other posts by webdbase2
 

Sorry, you can NOT post a reply.
This topic is closed.

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide