<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JotaDeveloper &#187; mysql</title>
	<atom:link href="http://blog.jotadeveloper.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jotadeveloper.com</link>
	<description>Programacion y algo más</description>
	<lastBuildDate>Wed, 20 Jan 2010 09:28:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Cómo crear el schema de la base datos con Anotaciones de Hibernate y Spring</title>
		<link>http://blog.jotadeveloper.com/2009/10/23/como-crear-el-schema-de-la-base-datos-con-anotaciones-de-hibernate-y-spring/</link>
		<comments>http://blog.jotadeveloper.com/2009/10/23/como-crear-el-schema-de-la-base-datos-con-anotaciones-de-hibernate-y-spring/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 04:46:31 +0000</pubDate>
		<dc:creator>Jota</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=2963</guid>
		<description><![CDATA[A veces es necesario hacer cambios a nuestra base de datos, y siempre estaremos lidiando con las herramientas gráficas o desde la consola, con los cambios en la base de datos, pero existen formas de hacer este trabajo &#8220;sucio&#8221; mucho más rapido y ahorrando tiempo.
En nuestro caso, usaremos Spring 2.5 y Hibernate 3.3 y MySQL, [...]]]></description>
			<content:encoded><![CDATA[<p>A veces <strong>es necesario hacer cambios a nuestra base de datos</strong>, y siempre estaremos lidiando con las herramientas gráficas o desde la consola, con los cambios en la base de datos, pero existen formas de hacer este trabajo &#8220;sucio&#8221; <strong>mucho más rapido y ahorrando tiempo</strong>.</p>
<p>En nuestro caso, usaremos Spring 2.5 y Hibernate 3.3 y MySQL, donde es necesario ya tengas armado los beans de conexión a la base de datos. El siguiente código es un array de cadenas, si en nuestro caso tenemos segmentado los xml de spring, los añadiremos de la siguiente manera.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// array de string para agregar todos tus archivos de configuración de spring</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> SPRING_CONFIG_FILES <span style="color: #339933;">=</span>
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;source/spring/config/xxxxxx-db-context.xml&quot;</span>, <span style="color: #0000ff;">&quot;source/spring/config/xxxxxxx-param-context.xml&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>A continuación, el código necesario para generar nuestra base de datos, el <strong>FileSystemXmlApplicationContext</strong> carga el Contexto de la Aplicación, y una vez teniendo el contexto obtenemos el SessionFactory, que en nuestro caso usamos Anotaciones, creamos el bean en base a la clase <strong>AnnotationSessionFactoryBean</strong> , esto es importante pues en base a esta clase usaremos los metodos <strong>dropDatabaseSchema();</strong> para borrar el actual schema (tablas, relaciones , etc) y luego ejecutamos <strong>createDatabaseSchema();</strong> para crear el nuevo schema.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// carga el application context de Spring</span>
 FileSystemXmlApplicationContext appContext <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FileSystemXmlApplicationContext<span style="color: #009900;">&#40;</span>SPRING_CONFIG_FILES<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Obtiene el bean del session factory</span>
 AnnotationSessionFactoryBean annotationSF <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>AnnotationSessionFactoryBean<span style="color: #009900;">&#41;</span>  appContext.<span style="color: #006633;">getBean</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;sessionFactory&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// si quieres eliminar el schema de la base de datos</span>
 annotationSF.<span style="color: #006633;">dropDatabaseSchema</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// para crear nuevamente el schema de la base de datos</span>
 annotationSF.<span style="color: #006633;">createDatabaseSchema</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Los archivos de configuración de <strong>Spring</strong>, deben lucir de la siguiente manera, hay que destacar el <strong>hibernate.dialect</strong> donde indicamos el dialecto que usaremos para crear el schema,  en el caso de MySQL puede ser MySAM o InnoDB, luego el parametro  <strong>hibernate.hbm2ddl.delimiter</strong> que también indicamos el tipo de tablas que usaremos en mi caso usaré <strong>type=InnoDB</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataSource&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.jdbc.datasource.DriverManagerDataSource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;driverClassName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${datasource.classname}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${datasource.urldb}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${datasource.userbd}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${datasource.pass}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sessionFactory&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dataSource&quot;</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;dataSource&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;annotatedClasses&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Clase1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
              <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Clase2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/list<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hibernateProperties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #808080; font-style: italic;">&lt;!-- &lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;update&lt;/prop&gt; --&gt;</span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;hibernate.dialect&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${datasource.dialect}
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;hibernate.show_sql&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${datasource.showsql}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;hibernate.hbm2ddl.delimiter&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${datasource.delimited}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

 <img src="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?view=1&post_id=2963" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.com/2009/10/23/como-crear-el-schema-de-la-base-datos-con-anotaciones-de-hibernate-y-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL presenta nuevo modelo de lanzamientos</title>
		<link>http://blog.jotadeveloper.com/2009/07/17/mysql-presenta-nuevo-modelo-de-lanzamientos/</link>
		<comments>http://blog.jotadeveloper.com/2009/07/17/mysql-presenta-nuevo-modelo-de-lanzamientos/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 07:44:07 +0000</pubDate>
		<dc:creator>Jota</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Noticias]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[bases de datos]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=2497</guid>
		<description><![CDATA[MySQL ha presentado un nuevo modelo de lanzamientos, la finalizad de los cambios es crear un modelo más dinámico, accesible, abierto y fácil de entender, todo esto con apresurar la salida de MySQL 6.0, el nombre clave del siguiente lanzamiento será Azalea (como puedes apreciar en el gráfico). El nuevo modelo se explica de la [...]]]></description>
			<content:encoded><![CDATA[<p><strong>MySQL</strong> ha presentado un <a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Rldi5teXNxbC5jb20vdGVjaC1yZXNvdXJjZXMvYXJ0aWNsZXMvbXlzcWwtcmVsZWFzZS1tb2RlbC5odG1s">nuevo modelo de lanzamientos</a>, la finalizad de los cambios es crear un modelo <strong>más dinámico, accesible, abierto y fácil de entender,</strong> todo esto con apresurar la salida de <strong>MySQL 6.0, </strong>el nombre clave del siguiente lanzamiento será <strong>Azalea</strong> (como puedes apreciar en el gráfico). El nuevo modelo se explica de la siguiente manera:<br />
</p>
<ul>
<li>La rama <strong><code>trunk</code> está siempre por lo menos en calidad Beta</strong>.</li>
<li>Un hito (milestone) comienza siempre en calidad Beta (nunca en Alpha) con una fusión (merge) entre las ramas <code>trunk</code> y <code>stage</code>.</li>
<li>Los lanzamientos de los hitos (milestones), con calidad de <strong>RC</strong> (Release Candidates), serán<strong> cada 3 o 6 meses</strong>.</li>
<li>Las ventanas de integración entre los hitos permitirán la inserción de nuevas características de las ramas de <code>stages</code>.</li>
<li>Los <strong>lanzamientos GA</strong> (General Availability) <strong>sucederán cada 12 a 18 meses.</strong></li>
<li>Nunca habrá más de dos lanzamientos con soporte activo.</li>
</ul>
<p><a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cuam90YWRldmVsb3Blci5jb20vd3AtY29udGVudC91cGxvYWRzLzIwMDkvMDcvcmVsZWFzZS1tb2RlbF9BLnBuZw=="><img class="alignnone size-full wp-image-2498" title="release-model_A" src="http://blog.jotadeveloper.com/wp-content/uploads/2009/07/release-model_A.png" alt="release-model_A" width="716" height="455" /></a></p>
 <img src="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?view=1&post_id=2497" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.com/2009/07/17/mysql-presenta-nuevo-modelo-de-lanzamientos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cambiando Contraseña de usuarios Virtuales en Roundcube 0.2.2</title>
		<link>http://blog.jotadeveloper.com/2009/07/14/cambiando-contrasena-de-usuarios-virtuales-en-roundcube-0-2-2/</link>
		<comments>http://blog.jotadeveloper.com/2009/07/14/cambiando-contrasena-de-usuarios-virtuales-en-roundcube-0-2-2/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 07:15:08 +0000</pubDate>
		<dc:creator>Jota</dc:creator>
				<category><![CDATA[Articulos]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[correo virtual]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[roundcube]]></category>

		<guid isPermaLink="false">http://blog.jotadeveloper.com/?p=2477</guid>
		<description><![CDATA[
Hace unos días hablaba de un cliente de correo imap llamado RoundCube,  pero le face falta una opción que aún no trae por defecto, es el cambiar la contraseña, el problema que cuando instalamos un servidor de correo con direcciones virtuales en Linux con MySQL generalmente se usa SALS por medio de PAM para los [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cuam90YWRldmVsb3Blci5jb20vd3AtY29udGVudC91cGxvYWRzLzIwMDkvMDcvcGFzczEuSlBH"><img class="alignnone size-full wp-image-2479" title="pass" src="http://blog.jotadeveloper.com/wp-content/uploads/2009/07/pass1.JPG" alt="pass" width="743" height="202" /></a></p>
<p>Hace unos días hablaba de un <a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cuam90YWRldmVsb3Blci5jb20vMjAwOS8wNi8yMy9yb3VuZGN1YmUtdW5hLWJ1ZW5hLWFsdGVybmF0aXZhLWEtc3F1aXJyZWxtYWlsLw==">cliente de correo imap llamado RoundCube</a>,  pero <strong>le face falta una opción que aún no trae por defecto, es el cambiar la contraseña</strong>, el problema que cuando instalamos un servidor de correo con direcciones virtuales en Linux con MySQL generalmente se usa <strong>SALS</strong> por medio de <strong>PAM </strong>para los inicios de sesión, eso deja a Roundcube con un problema, donde la contraseña queda fuera de su control. Pero existe una forma de integrar esta funcionalidad en en RoundCube, yo he visto algunos tutoriales que hablan de versiones inferiores, <strong>yo he probado esta en la 0.2.2 y funciona perfectamente</strong> incluso con el <a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5yb3VuZGN1YmV0aGVtZXMubmV0L25ld3MucGhwP2lkPTY=">skin de OutLook</a> para RoundCube.</p>
<p><span id="more-2477"></span></p>
<p>1. Abrir roundcube <strong>/index.php</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">==========================================================</span>
Busca               <span style="color: #009900;">&#91;</span>~ Linea <span style="color: #cc66cc;">188</span>  <span style="color: #009900;">&#93;</span>
&nbsp;
&nbsp;
<span style="color: #0000ff;">'settings'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'folders'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'create-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'rename-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'delete-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'subscribe'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'unsubscribe'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'add-identity'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'edit_identity.inc'</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #339933;">==========================================================</span>
Cambialo por<span style="color: #339933;">:</span>
&nbsp;
&nbsp;
<span style="color: #0000ff;">'settings'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'folders'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'create-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'rename-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'delete-folder'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'subscribe'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'unsubscribe'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'manage_folders.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'add-identity'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'edit_identity.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'password'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password.inc'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'save-password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password.inc'</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span></pre></div></div>

<p>2. Abrir roundcube <strong>/program/js/app.js</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Busca [ ~ Line 238 ]</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'settings'</span><span style="color: #339933;">:</span>
        this<span style="color: #339933;">.</span>enable_command<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;preferences&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;identities&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;save&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;folders&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">==========================================================</span>
<span style="color: #666666; font-style: italic;">//editalo y que quede así:</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'settings'</span><span style="color: #339933;">:</span>
        this<span style="color: #339933;">.</span>enable_command<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;preferences&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;identities&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;save&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;folders&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">==========================================================</span>
<span style="color: #666666; font-style: italic;">//Ahora busca esta línea   [ ~ Line 239 ]</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>action<span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;identities&quot;</span><span style="color: #339933;">||</span>this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>action<span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;edit-identity&quot;</span><span style="color: #339933;">||</span>this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>action<span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;add-identity&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  this<span style="color: #339933;">.</span>enable_command<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;add&quot;</span><span style="color: #339933;">,</span>this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>identities_level<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  this<span style="color: #339933;">.</span>enable_command<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;delete&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;edit&quot;</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">==========================================================</span>
<span style="color: #666666; font-style: italic;">//y agrega justo debajo</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>action<span style="color: #339933;">==</span><span style="color: #0000ff;">'password'</span> <span style="color: #339933;">||</span> this<span style="color: #339933;">.</span>env<span style="color: #339933;">.</span>action<span style="color: #339933;">==</span><span style="color: #0000ff;">'save-password'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000000; font-weight: bold;">var</span> input_current_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_current_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000000; font-weight: bold;">var</span> input_new_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_new_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000000; font-weight: bold;">var</span> input_repeat_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_repeat_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>input_current_password <span style="color: #339933;">&amp;&amp;</span> input_current_password<span style="color: #339933;">.</span>value<span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
              input_current_password<span style="color: #339933;">.</span>focus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>input_repeat_password<span style="color: #009900;">&#41;</span>
              input_repeat_password<span style="color: #339933;">.</span>focus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
          this<span style="color: #339933;">.</span>enable_command<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'save-password'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">==========================================================</span>
<span style="color: #666666; font-style: italic;">//Busca esta línea             [ ~ Line 904]</span>
&nbsp;
&nbsp;
      <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'delete-folder'</span><span style="color: #339933;">:</span>
        this<span style="color: #339933;">.</span>delete_folder<span style="color: #009900;">&#40;</span>props<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
<span style="color: #339933;">==========================================================</span>
<span style="color: #666666; font-style: italic;">//Inserta esta línea debajo:</span>
&nbsp;
&nbsp;
      <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">:</span>
        this<span style="color: #339933;">.</span>goto_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'save-password'</span><span style="color: #339933;">:</span>
        <span style="color: #000000; font-weight: bold;">var</span> input_current_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_current_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> input_new_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_new_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> input_repeat_password <span style="color: #339933;">=</span> rcube_find_object<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_repeat_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>input_new_password <span style="color: #339933;">&amp;&amp;</span> input_new_password<span style="color: #339933;">.</span>value<span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>input_repeat_password <span style="color: #339933;">&amp;&amp;</span> input_repeat_password<span style="color: #339933;">.</span>value<span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
                <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>input_current_password <span style="color: #339933;">&amp;&amp;</span> input_current_password<span style="color: #339933;">.</span>value<span style="color: #339933;">==</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                alert<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>get_label<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'nopassword'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                input_current_password<span style="color: #339933;">.</span>value<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                input_new_password<span style="color: #339933;">.</span>value<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                input_repeat_password<span style="color: #339933;">.</span>value<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                input_current_password<span style="color: #339933;">.</span>focus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>input_new_password <span style="color: #339933;">&amp;&amp;</span> input_repeat_password<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> input_new_password<span style="color: #339933;">.</span>value <span style="color: #339933;">!=</span> input_repeat_password<span style="color: #339933;">.</span>value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                alert<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>get_label<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'passwordinconsistency'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                input_new_password<span style="color: #339933;">.</span>value<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                input_repeat_password<span style="color: #339933;">.</span>value<span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
                input_new_password<span style="color: #339933;">.</span>focus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
                this<span style="color: #339933;">.</span>gui_objects<span style="color: #339933;">.</span>editform<span style="color: #339933;">.</span>submit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span></pre></div></div>

<p>3. Abrir <strong>program/localization/es_ES/labels.inc</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Agrega esto al final del archivo:</span>
&nbsp;
<span style="color: #000088;">$labels</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'changepassword'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Cambiar Clave'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$labels</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'current_password'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Clave Actual'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$labels</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'new_password'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Nueva Clave'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$labels</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'repeat_password'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Repetir Clave'</span><span style="color: #339933;">;</span></pre></div></div>

<p>4. Abrir <strong>program/localization/es_ES/messages.inc</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$messages</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nopassword'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Porfavor, Introduzca Nueva Clave.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$messages</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'passwordinconsistency'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Inconsistencia en las claves, pruebe otra vez.&quot;</span><span style="color: #339933;">;</span></pre></div></div>

</pre>
<p>5. Abrir <strong>skins/default/includes/settingstab.html</strong></p>
<p>En el skin de OutLook, existe solo un span, pero en el default aparecen uno por cada tab, en cualquiera de los dos agregar el código de abajo, sino en el OutLook no funcionará.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;settingstabpassword&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tablink&quot;</span><span style="color: #339933;">&gt;&lt;</span>roundcube<span style="color: #339933;">:</span>button command<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;link&quot;</span> label<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;password&quot;</span> title<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;changepassword&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tablink&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>span<span style="color: #339933;">&gt;</span></pre></div></div>

<p>6. Crear  <strong>/skins/default/templates/password.html</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;&lt;</span>roundcube<span style="color: #339933;">:</span>object name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pagetitle&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>title<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> <span style="color: #990000;">file</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/includes/links.html&quot;</span> <span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/settings.css&quot;</span> <span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> <span style="color: #990000;">file</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/includes/taskbar.html&quot;</span> <span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> <span style="color: #990000;">file</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/includes/header.html&quot;</span> <span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> <span style="color: #990000;">file</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/includes/settingstabs.html&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;userprefs-box&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;userprefs-title&quot;</span><span style="color: #339933;">&gt;&lt;</span>roundcube<span style="color: #339933;">:</span>label name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;changepassword&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
			<span style="color: #339933;">&lt;</span>div style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;padding:15px&quot;</span><span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span>object name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;passwordform&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
				<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;&lt;</span>br <span style="color: #339933;">/&gt;&lt;</span>roundcube<span style="color: #339933;">:</span>button command<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;save-password&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;input&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;button&quot;</span> label<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;save&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>p<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
		<span style="color: #339933;">&lt;</span>roundcube<span style="color: #339933;">:</span><span style="color: #b1b100;">include</span> <span style="color: #990000;">file</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/includes/settingscripts.html&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

<p>7. Crear  <strong>/program/steps/settings/password.inc</strong></p>
<p>Tal véz <strong>la parte más importante</strong>, cuando lleges a esta línea</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$passwordquery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE database.table SET password_field =ENCRYPT('&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$new_password</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;') WHERE user_name = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$emailuser</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;';&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Debes de modificar y <strong>agregar tu propio SQL para modificar la contraseña</strong>, asegurate que tus usuarios en la BD tengan los permisos suficientes para interactuar con las bases de datos de roundcube y tu bd virtual de usuarios.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?PHP</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> rcube_password_form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$attrib</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$RCMAIL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$CONFIG</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$a_show_cols</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> 	<span style="color: #0000ff;">'current_password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'new_password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">'repeat_password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$form_start</span><span style="color: #339933;">,</span> <span style="color: #000088;">$form_end</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> get_form_tags<span style="color: #009900;">&#40;</span><span style="color: #000088;">$attrib</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'save-password'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$out</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$form_start}</span>&lt;table&gt;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$a_show_cols</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$col</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$colprop</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$label</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$colprop</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$colprop</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'label'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$col</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> rcmail_get_edit_field<span style="color: #009900;">&#40;</span><span style="color: #000088;">$col</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attrib</span> <span style="color: #339933;">+</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'size'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$colprop</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'type'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$out</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;tr&gt;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>title<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;label for=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #009933; font-weight: bold;">%s</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #009933; font-weight: bold;">%s</span>&lt;/label&gt;&lt;/td&gt;&lt;td&gt;<span style="color: #009933; font-weight: bold;">%s</span>&lt;/td&gt;&lt;/tr&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>
              		<span style="color: #000088;">$attrib</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
              		Q<span style="color: #009900;">&#40;</span>rcube_label<span style="color: #009900;">&#40;</span><span style="color: #000088;">$label</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
               		<span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000088;">$out</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&lt;/table&gt;<span style="color: #006699; font-weight: bold;">$form_end</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$out</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> rcube_save_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_password</span><span style="color: #339933;">,</span><span style="color: #000088;">$new_password</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">,</span> <span style="color: #000088;">$RCMAIL</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$emailuser</span><span style="color: #339933;">=</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    	<span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> rcmail<span style="color: #339933;">::</span><span style="color: #004000;">get_instance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_dbh</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
     	<span style="color: #666666; font-style: italic;">// IMPORTANTE DEBES CAMBIAR ESTE CODIGO SQL POR EL TUYO PROPIO !!!!!</span>
    	<span style="color: #000088;">$passwordquery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPDATE database.table SET password_field =ENCRYPT('&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$new_password</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;') WHERE user_name = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$emailuser</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;';&quot;</span><span style="color: #339933;">;</span>   
&nbsp;
    	<span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$passwordquery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> encrypt_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_message</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'successfullysaved'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'confirmation'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> encrypt_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mcrypt_module_open'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mcrypt_module_open</span><span style="color: #009900;">&#40;</span>MCRYPT_TripleDES<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> MCRYPT_MODE_ECB<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$iv</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mcrypt_create_iv</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mcrypt_enc_get_iv_size</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> MCRYPT_RAND<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">mcrypt_generic_init</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #339933;">,</span> rcmail<span style="color: #339933;">::</span><span style="color: #004000;">get_instance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_des_key</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$iv</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$cypher</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mcrypt_generic</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">mcrypt_generic_deinit</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">mcrypt_module_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$td</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'des'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$cypher</span> <span style="color: #339933;">=</span> des<span style="color: #009900;">&#40;</span>rcmail<span style="color: #339933;">::</span><span style="color: #004000;">get_instance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_des_key</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pass</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$cypher</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$pass</span><span style="color: #339933;">;</span>
&nbsp;
      raise_error<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'code'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'php'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'file'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'message'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Could not convert encrypt password. Make sure Mcrypt is installed or lib/des.inc is available&quot;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cypher</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_pagetitle</span><span style="color: #009900;">&#40;</span>rcube_label<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;changepassword&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_handler</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'passwordform'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rcube_password_form'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_label</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'passwordinconsistency'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'nopassword'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$RCMAIL</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">action</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;save-password&quot;</span><span style="color: #339933;">:</span>
		<span style="color: #000088;">$curpass</span> <span style="color: #339933;">=</span> get_input_value<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_current_password'</span><span style="color: #339933;">,</span> RCUBE_INPUT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$newpass</span> <span style="color: #339933;">=</span> get_input_value<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_new_password'</span><span style="color: #339933;">,</span> RCUBE_INPUT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$repeatpass</span> <span style="color: #339933;">=</span> get_input_value<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'_repeat_password'</span><span style="color: #339933;">,</span> RCUBE_INPUT_POST<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$newpass</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$repeatpass</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> encrypt_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curpass</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			rcube_save_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$curpass</span><span style="color: #339933;">,</span><span style="color: #000088;">$newpass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_message</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'errorsaving'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		rcmail_overwrite_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$OUTPUT</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3doZWF0aWVzLnVzL2Jsb2cvMjAwOC8xMi8yMS9jaGFuZ2UtcGFzc3dvcmQtcm91bmRjdWJlLw==">Fuente en Inglés</a>.<br />
<a href="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGhpbGlwcGUtbGVyb3kuZnIvcG9zdC8yMDA4LzExLzE1L0V4dGVuc2lvbi1Sb3VuZGN1YmUtTW9kaWZpY2F0aW9uLWR1LW1vdC1kZS1wYXNzZS1lbWFpbA==">Fuente en Francés.</a></p>
 <img src="http://blog.jotadeveloper.com/wp-content/plugins/feed-statistics.php?view=1&post_id=2477" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.jotadeveloper.com/2009/07/14/cambiando-contrasena-de-usuarios-virtuales-en-roundcube-0-2-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
